mirror of
https://github.com/glest/glest-source.git
synced 2025-08-10 10:24:01 +02:00
CMakeLists.txt:checking, tuning the build system (#232)
* build.zg.sh scripts deprected * update for BSD * removed checking for VLC (not implemented) * docs updated * Install.md created. * scripts moved to scripts/ directory
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -110,3 +110,7 @@ CPackConfig.cmake
|
|||||||
CPackSourceConfig.cmake
|
CPackSourceConfig.cmake
|
||||||
/source/shared_lib/liblibmegaglest.a
|
/source/shared_lib/liblibmegaglest.a
|
||||||
/source/shared_lib/sources/streflop/libstreflop.a
|
/source/shared_lib/sources/streflop/libstreflop.a
|
||||||
|
|
||||||
|
# add build directories
|
||||||
|
build
|
||||||
|
local-build
|
||||||
|
26
.travis.yml
26
.travis.yml
@@ -57,17 +57,29 @@ before_install:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
# ALL THE BUILD COMMANDS HERE
|
# ALL THE BUILD COMMANDS HERE
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ "$Tr_Compiler_Version" != "6" ]; then
|
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ]; then
|
||||||
mkdir build;
|
mkdir build;
|
||||||
cd build;
|
cd build;
|
||||||
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DZETAGLEST_DATA_INSTALL_PATH=$PWD/local/data/zetaglest;
|
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_MODEL_VIEWER=ON -DBUILD_MAP_EDITOR=ON -DBUILD_IMPORT_EXPORT_TOOLS=ON -DBUILD_ZETAGLEST_TESTS=ON;
|
||||||
make && make install;
|
make && make install;
|
||||||
fi
|
fi
|
||||||
# use gcc 6 to test build using embedded libs, add -z option
|
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ "$Tr_Compiler_Version" = "6" ]; then mk/linux/build-zg.sh -e; fi
|
mkdir build;
|
||||||
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then mk/linux/build-zg.sh -w; fi
|
cd build;
|
||||||
# ^ -w may be removed on more modern dist: than trusty, problems related with 'new wx+clang+old gcc'
|
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_ZETAGLEST_TESTS=ON;
|
||||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then mk/macos/build-zg.sh; fi
|
make && make install;
|
||||||
|
fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||||
|
mkdir build;
|
||||||
|
cd build;
|
||||||
|
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local -DBUILD_MODEL_VIEWER=ON -DBUILD_MAP_EDITOR=ON -DBUILD_IMPORT_EXPORT_TOOLS=ON;
|
||||||
|
make && make install;
|
||||||
|
echo 'Mini test:';
|
||||||
|
echo '>>> zetaglest --version';
|
||||||
|
./zetaglest --version | head -3;
|
||||||
|
echo 'Dependencies:';
|
||||||
|
otool -L zetaglest;
|
||||||
|
fi
|
||||||
|
|
||||||
# https://docs.travis-ci.com/user/notifications/#IRC-notification
|
# https://docs.travis-ci.com/user/notifications/#IRC-notification
|
||||||
notifications:
|
notifications:
|
||||||
|
154
BUILD.md
154
BUILD.md
@@ -1,14 +1,40 @@
|
|||||||
# BUILD.md
|
# BUILD.md
|
||||||
|
|
||||||
|
The Mac build may need attention. If you are interested in helping us
|
||||||
|
test that the build completes and the game runs, please post or
|
||||||
|
subscribe to this ticket: [Current
|
||||||
|
Status](https://github.com/ZetaGlest/zetaglest-source/issues/25)
|
||||||
|
|
||||||
|
* **Getting the code:**
|
||||||
|
* [Set up the repositories locally](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#set-up-the-repositories-locally)
|
||||||
|
* [cloning your forks](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#procedure-for-cloning-your-forks)
|
||||||
|
|
||||||
|
* **Dependencies**
|
||||||
|
* [Windows](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#windows)
|
||||||
|
* [Linux, Mac OS, *BSD](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#linux)
|
||||||
|
* [Arch Linux](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#arch-linux)
|
||||||
|
* [Mac OS](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#mac-os)
|
||||||
|
* [BSD](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#bsd)
|
||||||
|
|
||||||
|
* * [Installing](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#installing)
|
||||||
|
|
||||||
|
* **Compiling**
|
||||||
|
* [Windows](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#windows)
|
||||||
|
* [Linux, Mac OS, *BSD](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#windows-1)
|
||||||
|
|
||||||
## Set up the repositories locally
|
## Set up the repositories locally
|
||||||
|
|
||||||
If you would like to contribute to development, you will need to
|
If you think you may be contributing to development, we suggest
|
||||||
**fork** and then **clone your forks** of these 2 repositories:
|
[**forking**](https://github.com/ZetaGlest/zetaglest-source#fork-destination-box)
|
||||||
|
and then **cloning your forks** of these 2 repositories. If you only
|
||||||
|
want to build and test out the game, and have no plans of submitting
|
||||||
|
patches, you don't need to worry about using the fork option (You can
|
||||||
|
fork later if you change your mind).
|
||||||
|
|
||||||
* https://github.com/ZetaGlest/zetaglest-source
|
* https://github.com/ZetaGlest/zetaglest-source
|
||||||
* https://github.com/ZetaGlest/zetaglest-data
|
* https://github.com/ZetaGlest/zetaglest-data
|
||||||
|
|
||||||
### Procedure for cloning your forks
|
### Procedure for cloning
|
||||||
|
|
||||||
1. Create a new directory to clone your **zetaglest-source** and
|
1. Create a new directory to clone your **zetaglest-source** and
|
||||||
**zetaglest-data** into e.g. call it `ZetaGlest`.
|
**zetaglest-data** into e.g. call it `ZetaGlest`.
|
||||||
@@ -16,7 +42,7 @@ If you would like to contribute to development, you will need to
|
|||||||
2. Enter (or 'cd') into the new directory (`ZetaGlest` in the example).
|
2. Enter (or 'cd') into the new directory (`ZetaGlest` in the example).
|
||||||
|
|
||||||
3. clone **zetaglest-source** and **zetaglest-data** using the clone
|
3. clone **zetaglest-source** and **zetaglest-data** using the clone
|
||||||
info provided by your fork. (Use the "Clone or Download" link, but
|
info provided by your fork or the main repos. (Use the "Clone or Download" link, but
|
||||||
**do** select `clone` **not** `Download Zip`.) Make sure the cloned
|
**do** select `clone` **not** `Download Zip`.) Make sure the cloned
|
||||||
repo directories are in the same directory, adjacent to each other (and
|
repo directories are in the same directory, adjacent to each other (and
|
||||||
**not** in a subdirectory).
|
**not** in a subdirectory).
|
||||||
@@ -29,8 +55,38 @@ If you have cloned the repositories this way, do not use the
|
|||||||
for information on how to sync your repo with the main upstream (no,
|
for information on how to sync your repo with the main upstream (no,
|
||||||
you can't juse use **_merge_**).
|
you can't juse use **_merge_**).
|
||||||
|
|
||||||
|
## Extra Options for compiling
|
||||||
|
|
||||||
|
Most people will never have to change the options when running `cmake`.
|
||||||
|
|
||||||
|
Some options you may want to change are:
|
||||||
|
|
||||||
|
To view models outside the game:
|
||||||
|
|
||||||
|
BUILD_MODEL_VIEWER=ON (off by default)
|
||||||
|
|
||||||
|
To edit maps:
|
||||||
|
|
||||||
|
BUILD_MAP_EDITOR=ON (off by default)
|
||||||
|
|
||||||
|
Use model import export tools:
|
||||||
|
|
||||||
|
BUILD_IMPORT_EXPORT_TOOLS=ON (off by default)
|
||||||
|
|
||||||
|
The **wxWidgets (libwxgtk3.0-dev on some systems)** and **libxml2-dev*
|
||||||
|
dependencies (mentioned below) is only required if you enable those
|
||||||
|
options.
|
||||||
|
|
||||||
|
To view all available options, use `cmake .. -LH` while in the build directory.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Follow the
|
||||||
|
[instructions](https://github.com/ZetaGlest/zetaglest-source/blob/develop/mk/windows/README.md)
|
||||||
|
listed in the `Windows` directory.
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
On Debian, Ubuntu, Fedora, Opensuse and even more Linux distributions,
|
On Debian, Ubuntu, Fedora, Opensuse and even more Linux distributions,
|
||||||
@@ -52,39 +108,29 @@ to indicate better which are optional and which are required.
|
|||||||
gcc g++ cmake libsdl2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev
|
gcc g++ cmake libsdl2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev
|
||||||
libx11-dev liblua5.2-dev libjpeg-dev libpng-dev libcurl4-gnutls-dev libircclient-dev
|
libx11-dev liblua5.2-dev libjpeg-dev libpng-dev libcurl4-gnutls-dev libircclient-dev
|
||||||
libglew-dev libftgl-dev libfribidi-dev libcppunit-dev libminiupnpc-dev libfreetype6-dev
|
libglew-dev libftgl-dev libfribidi-dev libcppunit-dev libminiupnpc-dev libfreetype6-dev
|
||||||
libgnutls28-dev libkrb5-dev libkrb5-dev libnghttp2-dev libopenal-dev libldap2-dev
|
libgnutls28-dev libkrb5-dev libkrb5-dev libnghttp2-dev libopenal-dev libldap2-dev
|
||||||
libwxgtk3.0-dev librtmp-dev libvlccore-dev libvlc-dev
|
librtmp-dev
|
||||||
|
|
||||||
Additionally for map editor and model viewer:
|
|
||||||
|
|
||||||
libwxgtk3.0-dev libxml2-dev
|
|
||||||
|
|
||||||
### Mac OS X
|
|
||||||
|
|
||||||
(Needs editing/updating)
|
|
||||||
[Current Status](https://github.com/ZetaGlest/zetaglest-source/issues/25)
|
[Current Status](https://github.com/ZetaGlest/zetaglest-source/issues/25)
|
||||||
|
|
||||||
### Windows
|
### Mac OS
|
||||||
|
|
||||||
Follow the [instructions](https://github.com/ZetaGlest/zetaglest-source/blob/develop/mk/windows/README.md) listed in the `Windows` directory.
|
You can install the dependencies with [brew](https://brew.sh/)
|
||||||
|
|
||||||
### OpenBSD
|
brew install sdl2 lua freetype ftgl libogg glew libvorbis cppunit glib fribidi miniupnpc wxmac
|
||||||
|
brew outdated cmake || brew upgrade cmake; brew outdated pkgconfig || brew upgrade pkgconfig
|
||||||
|
brew install Caskroom/cask/xquartz
|
||||||
|
|
||||||
|
### BSD
|
||||||
|
|
||||||
Below is a list of most of dependencies you will need.
|
Below is a list of most of dependencies you will need.
|
||||||
|
|
||||||
cmake libvorbis lua sdl2 openal wxWidgets fribidi ftgl nghttp2 gnutls glew jpeg png
|
A C++11 compiler is mandatory, so base (or package) **eg++** and **egcc**
|
||||||
miniupnpc curl freeealut
|
|
||||||
|
|
||||||
A C++11 compiler is mandatory, so base (or package) clang++, or eg++ (from 4.9.3)
|
|
||||||
|
|
||||||
You can install the dependencies using `pkg_add`:
|
You can install the dependencies using `pkg_add`:
|
||||||
|
|
||||||
`pkg_add curl libvorbis openal sdl2 git miniupnpc cmake wxWidgets
|
`pkg_add cmake curl freealut ftgl glew gnutls icu4c jpeg lua libircclient libvorbis
|
||||||
xerces-c lua icu4c freealut`
|
miniupnpc nghttp2 openal png sdl2 wxWidgets xerces-c`
|
||||||
|
|
||||||
#### Optional
|
|
||||||
|
|
||||||
`pkg_add g++ (either 4.9.3 or 6.2.0)`
|
|
||||||
|
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
|
|
||||||
@@ -97,24 +143,58 @@ lua51 miniupnpc openal sdl2 wxgtk3 xerces-c cmake ftjam git mesa`
|
|||||||
|
|
||||||
(Add other specific operating systems)
|
(Add other specific operating systems)
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
|
||||||
|
Now that you have the source code and the dependencies, you can either
|
||||||
|
compile ZetaGlest and run it without installing, or you can set options
|
||||||
|
to install it. If you plan to **install**, then you can **skip the sections below**
|
||||||
|
and read
|
||||||
|
[INSTALL.md](https://github.com/ZetaGlest/zetaglest-source/blob/develop/INSTALL.md)
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
### Linux
|
|
||||||
|
|
||||||
./build-zg.sh
|
|
||||||
|
|
||||||
### Mac OS X
|
|
||||||
|
|
||||||
./build-zg.sh
|
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
./build-zg.bat
|
./build-zg.bat
|
||||||
|
|
||||||
### OpenBSD
|
### Linux, Mac OS, BSD
|
||||||
|
|
||||||
`cmake <-DCMAKE_CXX_COMPILER=eg++>`
|
From the top of the project source directory:
|
||||||
|
|
||||||
`make`
|
mk build
|
||||||
|
cd build
|
||||||
|
|
||||||
|
(`cmake` On Linux or Mac OS)
|
||||||
|
|
||||||
|
cmake .. -DINSTALL_DIR_DATA=<absolute-path-to-data>
|
||||||
|
|
||||||
|
(`cmake` on BSD. Setting the 2 variables before the cmake command tells
|
||||||
|
cmake to use the correct compiler)
|
||||||
|
|
||||||
|
CC=`which egcc` CXX=`which eg++` cmake .. -DINSTALL_DIR_DATA=<absolute-path-to-data>
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
The zetaglest binaries will be in the `build/` directory. Run
|
||||||
|
'./zetaglest' to start the game.
|
||||||
|
|
||||||
|
<!-- This needs to be duplicated in the BUILD.md and INSTALL.md doc -->
|
||||||
|
The value for INSTALL_DIR_DATA is written to the game when compiled,
|
||||||
|
therefore if you ever move your data directory, you will have to
|
||||||
|
recompile ZetaGlest.
|
||||||
|
|
||||||
|
After you run `cmake` for the first time, you won't need to specify any
|
||||||
|
options unless you want to change previously-used options. Just use
|
||||||
|
|
||||||
|
cmake ..
|
||||||
|
|
||||||
|
(You'll need to run `make` and `make install` to rebuild.)
|
||||||
|
|
||||||
|
If you want to completely erase your previously-used options, remove
|
||||||
|
`build/CMakeCache.txt`.
|
||||||
|
|
||||||
|
If your build doesn't seem to be using the options you gave it, first
|
||||||
|
try removing CMakeCache.txt and rebuilding.
|
||||||
|
<!-- end duplication -->
|
||||||
|
|
||||||
### Other (add sections)
|
### Other (add sections)
|
||||||
|
177
CMakeLists.txt
177
CMakeLists.txt
@@ -24,20 +24,20 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/mk/cmake/Modules)
|
|||||||
IF(CMAKE_BUILD_TYPE)
|
IF(CMAKE_BUILD_TYPE)
|
||||||
MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
|
MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# *BSD users should use eg++ and egcc. It's advised not to overwrite
|
||||||
|
# $CMAKE_CXX_COMPILER, but instead precede `cmake` at the command line
|
||||||
|
# using CC=`which egcc` CXX=`which eg++`
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCXX "YES")
|
SET(CMAKE_COMPILER_IS_GNUCXX "YES")
|
||||||
# ADD_DEFINITIONS("-Qunused-arguments -Wno-switch")
|
# ADD_DEFINITIONS("-Qunused-arguments -Wno-switch")
|
||||||
ADD_DEFINITIONS("-Wno-switch")
|
ADD_DEFINITIONS("-Wno-switch")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
OPTION(BUILD_ZETAGLEST_MODEL_IMPORT_EXPORT_TOOLS "Build model import/export tools" ON)
|
|
||||||
OPTION(BUILD_ZETAGLEST_MODEL_VIEWER "Build model viewer" ON)
|
|
||||||
OPTION(BUILD_ZETAGLEST_MAP_EDITOR "Build map editor" ON)
|
|
||||||
OPTION(BUILD_ZETAGLEST "Build ZetaGlest" ON)
|
OPTION(BUILD_ZETAGLEST "Build ZetaGlest" ON)
|
||||||
OPTION(BUILD_ZETAGLEST_TESTS "Build ZetaGlest Unit Tests" OFF)
|
OPTION(BUILD_ZETAGLEST_TESTS "Build ZetaGlest Unit Tests" OFF)
|
||||||
OPTION(WANT_SINGLE_INSTALL_DIRECTORY "Use single install directory for everything. It is useful for example for MacOS cpack bundles." OFF)
|
|
||||||
OPTION(WANT_STATIC_LIBS "Builds as many static libs as possible." OFF)
|
OPTION(WANT_STATIC_LIBS "Builds as many static libs as possible." OFF)
|
||||||
OPTION(WANT_USE_VLC "Use libVLC to play videos." ON)
|
|
||||||
OPTION(WANT_USE_OpenSSL "Use libOpenSSL during CURL linking." ON)
|
OPTION(WANT_USE_OpenSSL "Use libOpenSSL during CURL linking." ON)
|
||||||
OPTION(WANT_USE_FriBiDi "Enable libFriBIDi support." ON)
|
OPTION(WANT_USE_FriBiDi "Enable libFriBIDi support." ON)
|
||||||
OPTION(WANT_USE_GoogleBreakpad "Enable GoogleBreakpad support." ON)
|
OPTION(WANT_USE_GoogleBreakpad "Enable GoogleBreakpad support." ON)
|
||||||
@@ -209,64 +209,28 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -pthread")
|
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -pthread")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(COMMON_INFO_ABOUT_PATH "(if the path is relative then is appended to the CMAKE_INSTALL_PREFIX)")
|
IF(NOT INSTALL_DIR_BIN)
|
||||||
IF(CMAKE_INSTALL_PREFIX STREQUAL "")
|
SET(INSTALL_DIR_BIN "${CMAKE_INSTALL_PREFIX}/games" CACHE PATH "The installation path for binaries")
|
||||||
MESSAGE(STATUS "*NOTE: NOT USING a Custom Data Install Path...")
|
ENDIF()
|
||||||
ELSE()
|
# The data dir will get defined as a macro at compile-time
|
||||||
IF(WANT_SINGLE_INSTALL_DIRECTORY AND NOT ZETAGLEST_SINGLE_DIRECTORY_INSTALL_PATH)
|
IF(NOT INSTALL_DIR_DATA)
|
||||||
SET(ZETAGLEST_SINGLE_DIRECTORY_INSTALL_PATH "zetaglest-game/" CACHE STRING "The single directory installation path for game ${COMMON_INFO_ABOUT_PATH}")
|
SET(INSTALL_DIR_DATA "${CMAKE_INSTALL_PREFIX}/share/zetaglest/" CACHE PATH "The installation path for data files")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT ZETAGLEST_BIN_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
SET(INSTALL_DIR_INI "${INSTALL_DIR_DATA}")
|
||||||
SET(ZETAGLEST_BIN_INSTALL_PATH "bin/" CACHE STRING "The installation path for binaries ${COMMON_INFO_ABOUT_PATH}")
|
IF(NOT INSTALL_DIR_DESKTOP)
|
||||||
ENDIF()
|
SET(INSTALL_DIR_DESKTOP "${CMAKE_INSTALL_PREFIX}/applications/" CACHE PATH "The installation path for desktop files")
|
||||||
IF(NOT ZETAGLEST_DATA_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
ENDIF()
|
||||||
SET(ZETAGLEST_DATA_INSTALL_PATH "share/zetaglest/" CACHE STRING "The installation path for data files ${COMMON_INFO_ABOUT_PATH}")
|
IF(NOT INSTALL_DIR_ICON)
|
||||||
ENDIF()
|
SET(INSTALL_DIR_ICON "${CMAKE_INSTALL_PREFIX}/share/pixmaps/" CACHE PATH "The installation path for icon files")
|
||||||
SET(ZETAGLEST_INI_INSTALL_PATH "${ZETAGLEST_DATA_INSTALL_PATH}")
|
ENDIF()
|
||||||
IF(NOT ZETAGLEST_DESKTOP_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
IF(NOT INSTALL_DIR_MAN)
|
||||||
SET(ZETAGLEST_DESKTOP_INSTALL_PATH "share/applications/" CACHE STRING "The installation path for desktop files ${COMMON_INFO_ABOUT_PATH}")
|
SET(INSTALL_DIR_MAN "${CMAKE_INSTALL_PREFIX}/share/man/man6/" CACHE PATH "The installation path for manpage files")
|
||||||
ENDIF()
|
|
||||||
IF(NOT ZETAGLEST_ICON_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
|
||||||
SET(ZETAGLEST_ICON_INSTALL_PATH "share/pixmaps/" CACHE STRING "The installation path for icon files ${COMMON_INFO_ABOUT_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
IF(NOT ZETAGLEST_MANPAGE_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
|
||||||
SET(ZETAGLEST_MANPAGE_INSTALL_PATH "share/man/man6/" CACHE STRING "The installation path for manpage files ${COMMON_INFO_ABOUT_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
IF(WANT_SINGLE_INSTALL_DIRECTORY)
|
|
||||||
FOREACH(ZG_PATH BIN DATA INI DESKTOP ICON)
|
|
||||||
IF(NOT ZETAGLEST_${ZG_PATH}_INSTALL_PATH)
|
|
||||||
SET(ZETAGLEST_${ZG_PATH}_INSTALL_PATH "${ZETAGLEST_SINGLE_DIRECTORY_INSTALL_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
ENDFOREACH()
|
|
||||||
ENDIF()
|
|
||||||
IF(NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
|
||||||
FOREACH(ZG_PATH DATA INI)
|
|
||||||
IF(IS_ABSOLUTE "${ZETAGLEST_${ZG_PATH}_INSTALL_PATH}")
|
|
||||||
SET(ZETAGLEST_FULL_${ZG_PATH}_INSTALL_PATH "${ZETAGLEST_${ZG_PATH}_INSTALL_PATH}/")
|
|
||||||
ELSE()
|
|
||||||
SET(ZETAGLEST_FULL_${ZG_PATH}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${ZETAGLEST_${ZG_PATH}_INSTALL_PATH}/")
|
|
||||||
ENDIF()
|
|
||||||
STRING(REGEX REPLACE "//+" "/" ZETAGLEST_FULL_${ZG_PATH}_INSTALL_PATH "${ZETAGLEST_FULL_${ZG_PATH}_INSTALL_PATH}")
|
|
||||||
ENDFOREACH()
|
|
||||||
|
|
||||||
IF(NOT CUSTOM_DATA_INSTALL_PATH)
|
|
||||||
SET(CUSTOM_DATA_INSTALL_PATH "${ZETAGLEST_FULL_DATA_INSTALL_PATH}")
|
|
||||||
# ^ someday this intermediate step may be removed
|
|
||||||
ENDIF()
|
|
||||||
SET(CUSTOM_INSTALL_PATHS_VALUES "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
#SET(PKG_DATADIR ${CUSTOM_DATA_INSTALL_PATH_VALUE})
|
|
||||||
#SET(PKG_BINDIR ${ZETAGLEST_BIN_INSTALL_PATH})
|
|
||||||
# ^ hard to tell for what it is needed and most likely both were set to wrong values, so let's try to not use them
|
|
||||||
MESSAGE(STATUS "*NOTE: Custom Data Install Path is [${CUSTOM_DATA_INSTALL_PATH}]")
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" ZG_BUILD_TYPE)
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" ZG_BUILD_TYPE)
|
||||||
IF(HAS_GIT STREQUAL "TRUE")
|
|
||||||
SET(CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}} ${GIT_VERSION_CMD}")
|
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
|
||||||
ENDIF()
|
SET(CMAKE_CXX_FLAGS_{ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}}")
|
||||||
SET(CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}} ${CUSTOM_INSTALL_PATHS_VALUES}")
|
|
||||||
|
|
||||||
# We do some funky character escaping to get the right stuff written out to
|
# We do some funky character escaping to get the right stuff written out to
|
||||||
# the final Makefile so we get the GIT Global Revsion #
|
# the final Makefile so we get the GIT Global Revsion #
|
||||||
@@ -296,51 +260,32 @@ IF(NOT WANT_DEPRECATION_WARNINGS)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
MARK_AS_ADVANCED(WANT_DEPRECATION_WARNINGS)
|
MARK_AS_ADVANCED(WANT_DEPRECATION_WARNINGS)
|
||||||
|
|
||||||
IF(NOT ZG_CMAKE_INSTALL_PREFIX AND NOT CMAKE_INSTALL_PREFIX STREQUAL "")
|
|
||||||
SET(ZG_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
|
||||||
ENDIF()
|
|
||||||
MESSAGE(STATUS "**NOTE: ZG_CMAKE_INSTALL_PREFIX is [${ZG_CMAKE_INSTALL_PREFIX}]")
|
|
||||||
|
|
||||||
SET(SDL_WINDOWS_DIR_DINC "SDL-2.0.x")
|
SET(SDL_WINDOWS_DIR_DINC "SDL-2.0.x")
|
||||||
SET(SDL_VERSION_NAME "SDL2")
|
SET(SDL_VERSION_NAME "SDL2")
|
||||||
SET(SDL_VERSION_SNAME "sdl")
|
SET(SDL_VERSION_SNAME "sdl")
|
||||||
|
|
||||||
IF (NOT ZETAGLEST_BIN_INSTALL_PATH STREQUAL "")
|
# output binaries to the top level of the build directory
|
||||||
SET(ZETAGLEST_BIN_OUTPUT_DIR "${CMAKE_INSTALL_PREFIX}/bin")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||||
ELSE()
|
|
||||||
SET(ZETAGLEST_BIN_OUTPUT_DIR "${ZETAGLEST_BIN_INSTALL_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
OPTION(WANT_DEV_OUTPATH "Use developer friendly output paths." OFF)
|
|
||||||
IF(UNIX AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
|
||||||
SET(ZETAGLEST_FRIENDLY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/mk/linux/")
|
|
||||||
ELSEIF(UNIX AND APPLE)
|
|
||||||
SET(ZETAGLEST_FRIENDLY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/mk/macos/")
|
|
||||||
ELSEIF(UNIX AND NOT APPLE)
|
|
||||||
SET(ZETAGLEST_FRIENDLY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/mk/other_unix/")
|
|
||||||
ELSE()
|
|
||||||
SET(ZETAGLEST_FRIENDLY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/data/glest_game/")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
|
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/lib
|
${PROJECT_SOURCE_DIR}/source/win32_deps/lib
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib
|
${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib)
|
${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib)
|
||||||
|
|
||||||
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
|
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/include
|
${PROJECT_SOURCE_DIR}/source/win32_deps/include
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854/include
|
${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854/include
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854
|
${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/include
|
${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/include
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/libogg-1.2.1/include
|
${PROJECT_SOURCE_DIR}/source/win32_deps/libogg-1.2.1/include
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/lua-5.1/src
|
${PROJECT_SOURCE_DIR}/source/win32_deps/lua-5.1/src
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b
|
${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141
|
${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/zlib-1.2.5
|
${PROJECT_SOURCE_DIR}/source/win32_deps/zlib-1.2.5
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/curl-7.21.3/include
|
${PROJECT_SOURCE_DIR}/source/win32_deps/curl-7.21.3/include
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/${SDL_WINDOWS_DIR_DINC}/include
|
${PROJECT_SOURCE_DIR}/source/win32_deps/${SDL_WINDOWS_DIR_DINC}/include
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/include)
|
${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/include)
|
||||||
|
|
||||||
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
|
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
|
||||||
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib)
|
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib)
|
||||||
@@ -356,8 +301,8 @@ IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
|
|||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/shared_lib )
|
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/shared_lib )
|
||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/glest_game )
|
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/glest_game )
|
||||||
#if(wxWidgets_FOUND)
|
#if(wxWidgets_FOUND)
|
||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/glest_map_editor )
|
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/glest_map_editor )
|
||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/g3d_viewer )
|
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/g3d_viewer )
|
||||||
#else()
|
#else()
|
||||||
# MESSAGE(STATUS "WARNING... the following game tools will NOT be built since we cannot find wxWidgets on this machine")
|
# MESSAGE(STATUS "WARNING... the following game tools will NOT be built since we cannot find wxWidgets on this machine")
|
||||||
# MESSAGE(STATUS "map editor, g3d viewer")
|
# MESSAGE(STATUS "map editor, g3d viewer")
|
||||||
@@ -380,42 +325,6 @@ IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|||||||
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
|
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT DEFINED CPACK_GENERATOR)
|
|
||||||
SET(CPACK_GENERATOR "DEB")
|
|
||||||
ENDIF()
|
|
||||||
# CPack configuration shared accross platforms
|
|
||||||
SET(CPACK_PACKAGE_NAME ${PKG_NAME})
|
|
||||||
IF(EXISTS "${PROJECT_SOURCE_DIR}/../zetaglest-data/others/zetaglest-long-description.txt.in")
|
|
||||||
FILE(READ "${PROJECT_SOURCE_DIR}/../zetaglest-data/others/zetaglest-long-description.txt.in" ZETAGLEST_LONG_DESCRIPTION)
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${ZETAGLEST_LONG_DESCRIPTION}")
|
|
||||||
ELSE()
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ZetaGlest")
|
|
||||||
ENDIF()
|
|
||||||
SET(CPACK_PACKAGE_VENDOR "zetaglest.github.io")
|
|
||||||
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
|
|
||||||
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
|
|
||||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "zetaglest")
|
|
||||||
SET(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
|
||||||
SET(CPACK_PACKAGE_VERSION "${ZETAGLEST_VERSION}")
|
|
||||||
SET(CPACK_PACKAGE_VERSION_MAJOR "${VER_MAJOR}")
|
|
||||||
SET(CPACK_PACKAGE_VERSION_MINOR "${VER_MINOR}")
|
|
||||||
SET(CPACK_PACKAGE_VERSION_PATCH "${VER_PATCH}")
|
|
||||||
|
|
||||||
IF("${CPACK_GENERATOR}" STREQUAL "DEB")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "ZetaGlest Team") #required
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "games")
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "p7zip-full")
|
|
||||||
ENDIF()
|
|
||||||
IF("${CPACK_GENERATOR}" STREQUAL "NSIS")
|
|
||||||
SET(CPACK_NSIS_DISPLAY_NAME "ZetaGlest")
|
|
||||||
SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/mk/windows/zetaglest.ico")
|
|
||||||
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/mk/windows/zetaglest.ico")
|
|
||||||
SET(CPACK_NSIS_URL_INFO_ABOUT "https://zetaglest.github.io")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
INCLUDE(CPack)
|
|
||||||
|
|
||||||
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
|
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
|
||||||
foreach( d ${DirDefs} )
|
foreach( d ${DirDefs} )
|
||||||
message( STATUS "=====> Found Define: " ${d} )
|
message( STATUS "=====> Found Define: " ${d} )
|
||||||
|
25
ChangeLog.md
25
ChangeLog.md
@@ -5,15 +5,40 @@ This documents notable or significant changes to
|
|||||||
information about the game from which it was forked, please see the
|
information about the game from which it was forked, please see the
|
||||||
[MegaGlest home page](https://megaglest.org/).
|
[MegaGlest home page](https://megaglest.org/).
|
||||||
|
|
||||||
|
## 2018-09-17
|
||||||
|
|
||||||
|
* CMakeLists.txt files have had a major tune-up (doesn't affect Windows users)
|
||||||
|
|
||||||
|
* The `mk/linux/build-zg.sh` and `mk/macos/build-zg.sh` scripts have
|
||||||
|
been deprecated. See the
|
||||||
|
[BUILD.md](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md)
|
||||||
|
document for updated instructions.
|
||||||
|
|
||||||
|
* Except for Windows, The map editor, model viewer and import/export
|
||||||
|
tools are no longer built by default. See BUILD.md for instructions on
|
||||||
|
how to enable building them.
|
||||||
|
|
||||||
|
* BSD build instructions updated
|
||||||
|
|
||||||
|
* [INSTALL.md](https://github.com/ZetaGlest/zetaglest-source/blob/develop/INSTALL.md) document created
|
||||||
|
|
||||||
|
* man pages are no longer generated each time a build is performed.
|
||||||
|
They must be manually generated when the help usage output is changed.
|
||||||
|
|
||||||
|
* debugging scripts have been moved to a scripts/ directory (they'll
|
||||||
|
need reviewing and editing before use)
|
||||||
|
|
||||||
## 2018-09-07
|
## 2018-09-07
|
||||||
|
|
||||||
Upgrade [libircclient](https://sourceforge.net/projects/libircclient/) embedded library from 1.3 to 1.10/
|
Upgrade [libircclient](https://sourceforge.net/projects/libircclient/) embedded library from 1.3 to 1.10/
|
||||||
[view ChangeLog](https://github.com/ZetaGlest/zetaglest-source/commit/64cc6c3cb10c7fd6d97fa0af4a10b431100c58b0#diff-2a35002207d9e074987b668f273e598d)
|
[view ChangeLog](https://github.com/ZetaGlest/zetaglest-source/commit/64cc6c3cb10c7fd6d97fa0af4a10b431100c58b0#diff-2a35002207d9e074987b668f273e598d)
|
||||||
|
|
||||||
|
|
||||||
## 2018-09-05
|
## 2018-09-05
|
||||||
|
|
||||||
* Special effects added to fading/vanishing corpses
|
* Special effects added to fading/vanishing corpses
|
||||||
|
|
||||||
|
|
||||||
## 2018-09-04
|
## 2018-09-04
|
||||||
|
|
||||||
* zoom-out restriction during network play removed
|
* zoom-out restriction during network play removed
|
||||||
|
119
INSTALL.md
Normal file
119
INSTALL.md
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
# Installing ZetaGlest
|
||||||
|
|
||||||
|
It's recommended to first [read about the system
|
||||||
|
requirements](https://zetaglest.github.io/docs/system_requirements.html).
|
||||||
|
(even though they probably need editing and updating)
|
||||||
|
|
||||||
|
You can install from source or download Installers or packages for your
|
||||||
|
operating system.
|
||||||
|
|
||||||
|
There hasn't been a formal first release of ZetaGlest yet, but you may
|
||||||
|
try development snapshots.
|
||||||
|
|
||||||
|
## Binary Packages
|
||||||
|
|
||||||
|
**Note:** Installation is not necessary to run the game. You can build
|
||||||
|
the game from source and run it without installing
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
|
||||||
|
### Installer
|
||||||
|
|
||||||
|
[https://github.com/ZetaGlest/windows-installer](ZetaGlest Windows Installer)
|
||||||
|
|
||||||
|
### Build and Install from source code
|
||||||
|
|
||||||
|
https://github.com/ZetaGlest/zetaglest-source/blob/develop/mk/windows/README.md
|
||||||
|
|
||||||
|
## Linux, Mac OS, BSD
|
||||||
|
|
||||||
|
Review the dependency information and instructions for [building from
|
||||||
|
source](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md).
|
||||||
|
|
||||||
|
From the top of the project source directory:
|
||||||
|
|
||||||
|
mk build
|
||||||
|
cd build
|
||||||
|
|
||||||
|
**Note:** Using the paths specified below, you will need super-user
|
||||||
|
privileges when you run `make install`.
|
||||||
|
|
||||||
|
`cmake` On **Linux or Mac OS**
|
||||||
|
|
||||||
|
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
|
||||||
|
|
||||||
|
`cmake` on **BSD**. Setting the 2 variables before the cmake command tells
|
||||||
|
cmake to use the correct compiler.
|
||||||
|
|
||||||
|
CC=`which egcc` CXX=`which eg++` cmake .. -DCMAKE_INSTALL_PREFIX=/usr
|
||||||
|
|
||||||
|
Make and install the program:
|
||||||
|
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
The binary will be in CMAKE_INSTALL_PREFIX/games (i.e. /usr/games)
|
||||||
|
|
||||||
|
Before you run `make`, you can confirm the installation directories of
|
||||||
|
files that will be installed by entering `cmake .. -LH`. For example,
|
||||||
|
These are the destination directories when
|
||||||
|
`-DCMAKE_INSTALL_PREFIX=/home/andy/local` is used:
|
||||||
|
|
||||||
|
```
|
||||||
|
// The installation path for binaries
|
||||||
|
INSTALL_DIR_BIN:PATH=/home/andy/local/games
|
||||||
|
|
||||||
|
// The installation path for data files
|
||||||
|
INSTALL_DIR_DATA:PATH=/home/andy/local/share/zetaglest
|
||||||
|
|
||||||
|
// The installation path for desktop files
|
||||||
|
INSTALL_DIR_DESKTOP:PATH=/home/andy/local/applications
|
||||||
|
|
||||||
|
// The installation path for icon files
|
||||||
|
INSTALL_DIR_ICON:PATH=/home/andy/local/share/pixmaps
|
||||||
|
|
||||||
|
// The installation path for manpage files
|
||||||
|
INSTALL_DIR_MAN:PATH=/home/andy/local/share/man/man6
|
||||||
|
```
|
||||||
|
|
||||||
|
If you wish to install to a location that does not require super-user
|
||||||
|
privileges, change '/usr' to a location to which you have write access.
|
||||||
|
|
||||||
|
<!-- This needs to be duplicated in the BUILD.md and INSTALL.md doc -->
|
||||||
|
The value for INSTALL_DIR_DATA is written to the game when compiled,
|
||||||
|
therefore if you ever move your data directory, you will have to
|
||||||
|
recompile ZetaGlest.
|
||||||
|
|
||||||
|
After you run `cmake` for the first time, you won't need to specify any
|
||||||
|
options unless you want to change previously-used options. Just use
|
||||||
|
|
||||||
|
cmake ..
|
||||||
|
|
||||||
|
(You'll need to run `make` and `make install` to rebuild.)
|
||||||
|
|
||||||
|
If you want to completely erase your previously-used options, remove
|
||||||
|
`build/CMakeCache.txt`.
|
||||||
|
|
||||||
|
If your build doesn't seem to be using the options you gave it, first
|
||||||
|
try removing CMakeCache.txt and rebuilding.
|
||||||
|
<!-- end duplication -->
|
||||||
|
|
||||||
|
**Note:** The majority of the game data is not installed during the
|
||||||
|
steps above. The files from the zetaglest-data repo must be copied into
|
||||||
|
CMAKE_INSTALL_PREFIX/share/zetaglest, or specify an existing path to
|
||||||
|
data by adding this option to cmake:
|
||||||
|
|
||||||
|
`-DINSTALL_DIR_DATA=<absolute-path-to-data>`
|
||||||
|
|
||||||
|
(data packages will be created soon -andy5995 2018-09-16)
|
||||||
|
|
||||||
|
#### Uninstalling
|
||||||
|
|
||||||
|
Makefiles generated with cmake do not have an 'uninstall' option. There
|
||||||
|
is a [discussion at this
|
||||||
|
link](https://stackoverflow.com/questions/41471620/cmake-support-make-uninstall)
|
||||||
|
on how to do that.
|
||||||
|
|
||||||
|
Instead of using `make install`, you may wish to install using a
|
||||||
|
distribution package. Later, you could uninstall using your package
|
||||||
|
manager.
|
69
README.md
69
README.md
@@ -14,6 +14,14 @@ in one of 17 naturally looking settings, which, like the unit models,
|
|||||||
are crafted with great attention to detail. A lot of additional game
|
are crafted with great attention to detail. A lot of additional game
|
||||||
data can be downloaded from within the game at no cost.
|
data can be downloaded from within the game at no cost.
|
||||||
|
|
||||||
|
* **README Contents**
|
||||||
|
* [Stay Informed (Updates)](https://github.com/ZetaGlest/zetaglest-source#stay-informed-updates)
|
||||||
|
* [Project Goals](https://github.com/ZetaGlest/zetaglest-source#why-this-fork-project-goals)
|
||||||
|
* [Download executable files](https://github.com/ZetaGlest/zetaglest-source#download-executable-files)
|
||||||
|
* [Extra Tech trees, mods, tilesets, scenarious (not yet available on the ZetaGlest server)](https://github.com/ZetaGlest/zetaglest-source#extra-tech-trees-mods-tilesets-scenarious-not-yet-available-on-the-zetaglest-server)
|
||||||
|
* [Contributing and Testing](https://github.com/ZetaGlest/zetaglest-source#contributing-and-testing)
|
||||||
|
* [Contact](https://github.com/ZetaGlest/zetaglest-source#contact)
|
||||||
|
|
||||||
**[System Requirements](https://zetaglest.github.io/docs/system_requirements.html)**
|
**[System Requirements](https://zetaglest.github.io/docs/system_requirements.html)**
|
||||||
|
|
||||||
**[Screenshots](https://github.com/ZetaGlest/screenshots)**
|
**[Screenshots](https://github.com/ZetaGlest/screenshots)**
|
||||||
@@ -36,64 +44,31 @@ Open games and [Server list and player stats](https://zetaglest.dreamhosters.com
|
|||||||
|
|
||||||
ZetaGlest forked from MegaGlest at v3.13.0-dev ([12998eb](https://github.com/ZetaGlest/zetaglest-source/commit/12998eb10f6447ac89a45d1e6d76f17946647b7a))
|
ZetaGlest forked from MegaGlest at v3.13.0-dev ([12998eb](https://github.com/ZetaGlest/zetaglest-source/commit/12998eb10f6447ac89a45d1e6d76f17946647b7a))
|
||||||
|
|
||||||
I noticed that there were some good feature requests in the MegaGlest
|
Because we love MegaGlest! We wanted to take the project into a
|
||||||
forum, as well as some mods, but it seemed that implementing and
|
slightly different direction, and therefore we forked MegaGlest into
|
||||||
testing had a pace that I was uncomfortable with. After talking about
|
the ZetaGlest project.
|
||||||
this with another player, I decided to fork the project and see if I
|
|
||||||
could assemble regular contributors and players who had similar
|
|
||||||
feelings about the speed of progress, adding artwork, promoting mods
|
|
||||||
made by contributors, and code enhancements. I would like to encourage
|
|
||||||
contributions, no matter how small, in the hopes of improving an
|
|
||||||
already fun game and making the experience even more fun that it has
|
|
||||||
been for me.
|
|
||||||
|
|
||||||
## Download executable files
|
## Download executable files
|
||||||
|
|
||||||
On Windows, the easiest way to get started is to [download and run the installer](https://github.com/ZetaGlest/windows-installer).
|
On Windows, the easiest way to get started is to [download and run the
|
||||||
If you want to contribute with the code on Windows, [please follow these instructions](https://github.com/ZetaGlest/zetaglest-source/blob/develop/mk/windows/README.md).
|
installer](https://github.com/ZetaGlest/windows-installer). If you want
|
||||||
|
to contribute with the code on Windows, [please follow these
|
||||||
|
instructions](https://github.com/ZetaGlest/zetaglest-source/blob/develop/mk/windows/README.md).
|
||||||
|
|
||||||
We are having [build issues on **Mac OSX**
|
For other operating systems, you must **[build and install from
|
||||||
systems](https://github.com/ZetaGlest/zetaglest-source/issues/25). One
|
source]**(https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md)
|
||||||
person reported he couldn't get ZetaGlest to build, and another reported
|
(Later, we'll be providing binary packages).
|
||||||
that once built, it would not run. Please help if you can.
|
|
||||||
|
|
||||||
For other operating systems, you must [build from
|
|
||||||
source](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md) (Later,
|
|
||||||
we'll be providing binary packages). If you would like to play
|
|
||||||
with other users, we recommend this **[dev
|
|
||||||
snapshot](https://github.com/ZetaGlest/zetaglest-source/releases)**.
|
|
||||||
You will also need to download the
|
|
||||||
[data](https://github.com/ZetaGlest/zetaglest-data/releases).
|
|
||||||
|
|
||||||
(The ETA for the first official release can be viewed from the [development
|
(The ETA for the first official release can be viewed from the [development
|
||||||
milestone](https://github.com/ZetaGlest/zetaglest-source/milestone/1).)
|
milestone](https://github.com/ZetaGlest/zetaglest-source/milestone/1).)
|
||||||
|
|
||||||
See [Build instructions](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md)
|
## Running
|
||||||
|
|
||||||
### Building the game yourself
|
./zetaglest (if you didn't install)
|
||||||
|
|
||||||
#### On Windows:
|
OR
|
||||||
|
|
||||||
[Follow the instructions in this Readme file](https://github.com/ZetaGlest/zetaglest-source/blob/develop/mk/windows/README.md).
|
zetaglest (if you installed and the binary is in your PATH)
|
||||||
|
|
||||||
#### On Linux:
|
|
||||||
|
|
||||||
Use these commands:
|
|
||||||
|
|
||||||
mkdir ZetaGlest
|
|
||||||
cd ZetaGlest
|
|
||||||
git clone https://github.com/ZetaGlest/zetaglest-source.git
|
|
||||||
git clone https://github.com/ZetaGlest/zetaglest-data.git
|
|
||||||
|
|
||||||
Afterward, to
|
|
||||||
[build](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md),
|
|
||||||
change to the zetaglest-source/mk/ directory, select your operating system and run
|
|
||||||
|
|
||||||
./build-zg.sh
|
|
||||||
|
|
||||||
To execute the game:
|
|
||||||
|
|
||||||
./zetaglest
|
|
||||||
|
|
||||||
To run your own headless (dedicated) server:
|
To run your own headless (dedicated) server:
|
||||||
|
|
||||||
|
@@ -6,6 +6,15 @@
|
|||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "This script has been deprecated. Please see"
|
||||||
|
echo "https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md"
|
||||||
|
echo "For updated build instructions."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Configuration section
|
# Configuration section
|
||||||
#
|
#
|
||||||
@@ -311,12 +320,12 @@ if [ $FORCE_32BIT_CROSS_COMPILE != 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$COMPILATION_WITHOUT" != "0" ] && [ "$COMPILATION_WITHOUT" != "" ]; then
|
if [ "$COMPILATION_WITHOUT" != "0" ] && [ "$COMPILATION_WITHOUT" != "" ]; then
|
||||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_ZETAGLEST_MAP_EDITOR=OFF -DBUILD_ZETAGLEST_MODEL_VIEWER=OFF"
|
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_MAP_EDITOR=OFF -DBUILD_MODEL_VIEWER=OFF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $MAKE_ONLY = 0 ]; then
|
if [ $MAKE_ONLY = 0 ]; then
|
||||||
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS} AND WANT_STATIC_LIBS = ${WANT_STATIC_LIBS}"
|
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS} AND WANT_STATIC_LIBS = ${WANT_STATIC_LIBS}"
|
||||||
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON $WANT_STATIC_LIBS -DBUILD_ZETAGLEST_TESTS=$BUILD_ZETAGLEST_TESTS -DBREAKPAD_ROOT=$BREAKPAD_ROOT $EXTRA_CMAKE_OPTIONS ../../..
|
cmake -DCMAKE_INSTALL_PREFIX='' $WANT_STATIC_LIBS -DBUILD_ZETAGLEST_TESTS=$BUILD_ZETAGLEST_TESTS -DBREAKPAD_ROOT=$BREAKPAD_ROOT $EXTRA_CMAKE_OPTIONS ../../..
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
||||||
fi
|
fi
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
DataPath=$APPLICATIONPATH/../../../zetaglest-data/
|
|
||||||
ServerListPath=$APPLICATIONPATH/../shared/
|
|
||||||
GlestKeysIniPath=$APPLICATIONPATH/../shared/
|
|
@@ -8,6 +8,14 @@
|
|||||||
# Default to English language output so we can understand your bug reports
|
# Default to English language output so we can understand your bug reports
|
||||||
#
|
#
|
||||||
# Modified by Andy Alt for ZetaGlest <https://zetaglest.github.io/>
|
# Modified by Andy Alt for ZetaGlest <https://zetaglest.github.io/>
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "This script has been deprecated. Please see"
|
||||||
|
echo "https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md"
|
||||||
|
echo "For updated build instructions."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
exit 0
|
||||||
export LANG=C
|
export LANG=C
|
||||||
|
|
||||||
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
|
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
|
||||||
@@ -191,7 +199,7 @@ if [ "$FORCE_EMBEDDED_LIBS" != "0" ] && [ "$FORCE_EMBEDDED_LIBS" != "" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$COMPILATION_WITHOUT" != "0" ] && [ "$COMPILATION_WITHOUT" != "" ]; then
|
if [ "$COMPILATION_WITHOUT" != "0" ] && [ "$COMPILATION_WITHOUT" != "" ]; then
|
||||||
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_ZETAGLEST_MAP_EDITOR=OFF -DBUILD_ZETAGLEST_MODEL_VIEWER=OFF"
|
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_MAP_EDITOR=OFF -DBUILD_MODEL_VIEWER=OFF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MAKE_ONLY" -eq "0" ]; then
|
if [ "$MAKE_ONLY" -eq "0" ]; then
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
DataPath=$APPLICATIONPATH/../../../zetaglest-data/
|
|
||||||
ServerListPath=$APPLICATIONPATH/../shared/
|
|
||||||
GlestKeysIniPath=$APPLICATIONPATH/../shared/
|
|
@@ -1,94 +0,0 @@
|
|||||||
; === propertyMap File ===
|
|
||||||
; This file defines default properties and values. Do not edit this file,
|
|
||||||
; instead, to modify, copy any properties to glestuser.ini, then change these as
|
|
||||||
; needed. Values contained in glestuser.ini will overwrite values found here.
|
|
||||||
;
|
|
||||||
; For explanation of these properties, please refer to the MegaGlest wiki at
|
|
||||||
; http://wiki.megaglest.org/
|
|
||||||
;
|
|
||||||
AiLog=0
|
|
||||||
AiRedir=false
|
|
||||||
AllowDownloadDataSynch=false
|
|
||||||
AllowGameDataSynchCheck=false
|
|
||||||
AllowRotateUnits=true
|
|
||||||
AnnouncementURL=http://zetaglest.dreamhosters.com/files/announcement.txt
|
|
||||||
AutoMaxFullScreen=false
|
|
||||||
AutoTest=false
|
|
||||||
CheckGlCaps=true
|
|
||||||
ColorBits=32
|
|
||||||
ConsoleMaxLines=6
|
|
||||||
ConsoleMaxLinesStored=25
|
|
||||||
ConsoleTimeout=20
|
|
||||||
DataPath=$APPLICATIONDATAPATH/
|
|
||||||
LogPath=$HOME/.zetaglest/
|
|
||||||
DayTime=1000
|
|
||||||
DebugLogFile=debug.log
|
|
||||||
DebugMode=false
|
|
||||||
DebugPerformance=false
|
|
||||||
DebugNetwork=false
|
|
||||||
DebugWorldSynch=false
|
|
||||||
DepthBits=16
|
|
||||||
FactoryGraphics=OpenGL
|
|
||||||
FactorySound=OpenAL
|
|
||||||
FastSpeedLoops=8
|
|
||||||
FileArchiveExtension=.7z
|
|
||||||
FileArchiveExtractCommand=$APPLICATIONDATAPATH/p7zip/7z
|
|
||||||
FileArchiveExtractCommandParameters=x -o"{outputpath}" "{archivename}"
|
|
||||||
FileArchiveCompressCommand=$APPLICATIONDATAPATH/p7zip/7z
|
|
||||||
FileArchiveCompressCommandParameters=a -r -xr!?svn\* "{archivename}" "{archivefiles}"
|
|
||||||
FileArchiveCompressCommandSuccessResult=0
|
|
||||||
Filter=Bilinear
|
|
||||||
FilterMaxAnisotropy=1
|
|
||||||
FirstTime=false
|
|
||||||
FocusArrows=true
|
|
||||||
FogOfWarSmoothing=true
|
|
||||||
FogOfWarSmoothingFrameSkip=3
|
|
||||||
FontConsoleBaseSize=14
|
|
||||||
FontConsolePostfix=-*-*-*-*-*-*-*
|
|
||||||
FontConsolePrefix=-*-arial-*-r-*-*-
|
|
||||||
FontDisplayBaseSize=12
|
|
||||||
FontDisplayPostfix=-*-*-*-*-*-*-*
|
|
||||||
FontDisplayPrefix=-*-arial-*-r-*-*-
|
|
||||||
FontDisplaySmallBaseSize=12
|
|
||||||
FontMenuBigBaseSize=20
|
|
||||||
FontMenuBigPostfix=-*-*-*-*-*-*-*
|
|
||||||
FontMenuBigPrefix=-*-arial-*-r-*-*-
|
|
||||||
FontMenuNormalBaseSize=14
|
|
||||||
FontMenuNormalPostfix=-*-*-*-*-*-*-*
|
|
||||||
FontMenuNormalPrefix=-*-arial-*-r-*-*-
|
|
||||||
FontMenuVeryBigBaseSize=25
|
|
||||||
FontSizeAdjustment=0
|
|
||||||
FONT_HEIGHT_TEXT=yW
|
|
||||||
Lang=english
|
|
||||||
MaxLights=3
|
|
||||||
Masterserver=http://zetaglest.dreamhosters.com/
|
|
||||||
NetPlayerName=newbie
|
|
||||||
NetworkConsistencyChecks=true
|
|
||||||
PhotoMode=false
|
|
||||||
PortList=61357,61367,61377,61387,61397
|
|
||||||
PortServer=61357
|
|
||||||
RefreshFrequency=75
|
|
||||||
ScreenHeight=600
|
|
||||||
ScreenWidth=800
|
|
||||||
ServerIp=192.168.0.107
|
|
||||||
ShadowFrameSkip=2
|
|
||||||
ShadowTextureSize=512
|
|
||||||
Shadows=Projected
|
|
||||||
SoundStaticBuffers=16
|
|
||||||
SoundStreamingBuffers=4
|
|
||||||
SoundVolumeAmbient=80
|
|
||||||
SoundVolumeFx=80
|
|
||||||
SoundVolumeMusic=90
|
|
||||||
StencilBits=0
|
|
||||||
Textures3D=true
|
|
||||||
TranslationGetURL=https://www.transifex.com/api/2/project/megaglest/resource/$file/translation/$language
|
|
||||||
TranslationGetURLDetails=https://www.transifex.com/api/2/project/megaglest/resource/$file/?details
|
|
||||||
TranslationGetURLFileList=main-language-file|megapack-language-file|loading-screen-hints|tutorials-1-very-basic-tutorial|tutorials-2-basic-tutorial|tutorials-3-advanced-tutorial|scenarios-amazones|scenarios-amazones-light|scenarios-capture-enemy-flag|scenarios-storming
|
|
||||||
TranslationGetURLFileListMapping=data/lang/$language.lng|techs/megapack/lang/megapack_$language.lng|data/lang/hint/hint_$language.lng|tutorials/1_very_basic_tutorial/1_very_basic_tutorial_$language.lng|tutorials/2_basic_tutorial/2_basic_tutorial_$language.lng|tutorials/3_advanced_tutorial/3_advanced_tutorial_$language.lng|scenarios/amazones/amazones_$language.lng|scenarios/amazones_light/amazones_light_$language.lng|scenarios/capture_enemy_flag/capture_enemy_flag_$language.lng|scenarios/storming/storming_$language.lng
|
|
||||||
TranslationGetURLLanguage=en
|
|
||||||
TranslationGetURLPassword=
|
|
||||||
TranslationGetURLUser=<enter username>
|
|
||||||
UnitParticles=true
|
|
||||||
UserData_Root=$HOME/.zetaglest/
|
|
||||||
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
|
||||||
Windowed=true
|
|
@@ -1,107 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Use this script to build MegaGlest Binary Archive for a Version Release
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# 2011 Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
|
||||||
# 2015 Rewritten by filux <heross(@@)o2.pl>
|
|
||||||
# Copyright (c) 2011-2015 under GNU GPL v3.0+
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
LANG=C
|
|
||||||
|
|
||||||
# set this to non 0 to skip building the binary
|
|
||||||
skipbinarybuild=0
|
|
||||||
if [ "$1" = "-CI" ]; then skipbinarybuild=1; fi
|
|
||||||
|
|
||||||
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
|
|
||||||
cd "$CURRENTDIR"
|
|
||||||
|
|
||||||
# Consider setting this for small packages if there's plenty of RAM and CPU available:
|
|
||||||
#export XZ_OPT="$XZ_OPT -9e"
|
|
||||||
|
|
||||||
if [ "$1" = "-CI" ] || [ "$1" = "-" ] || [ "$(echo "$1" | grep '\--show-result-path')" != "" ]; then
|
|
||||||
if [ "$2" != "" ]; then
|
|
||||||
SOURCE_BRANCH="$2"
|
|
||||||
if [ "$3" != "" ]; then NUMCORES="$3"; fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
VERSION="$(../linux/mg-version.sh --version)"
|
|
||||||
kernel="macos"
|
|
||||||
REPODIR="$CURRENTDIR/../../"
|
|
||||||
if [ -d "$REPODIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
|
|
||||||
cd "$REPODIR"
|
|
||||||
if [ "$SOURCE_BRANCH" = "" ]; then SOURCE_BRANCH="$(git branch | grep '^* ' | awk '{print $2}')"; fi
|
|
||||||
# on macos are problems with more advanced using awk ^
|
|
||||||
SOURCE_COMMIT="$(echo "[$(git rev-list HEAD --count).$(git log -1 --format=%h --abbrev=7)]")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ARCHIVE_TYPE="tar.bz2"
|
|
||||||
SNAPSHOTNAME="mg-binary-$kernel"
|
|
||||||
SN_PACKAGE="$SNAPSHOTNAME-$VERSION-$SOURCE_BRANCH.$ARCHIVE_TYPE"
|
|
||||||
RELEASENAME="megaglest-binary-$kernel"
|
|
||||||
PACKAGE="$RELEASENAME-$VERSION.$ARCHIVE_TYPE"
|
|
||||||
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
|
|
||||||
|
|
||||||
if [ "$SOURCE_BRANCH" != "" ] && [ "$SOURCE_BRANCH" != "master" ] && [ "$(echo "$VERSION" | grep '\-dev$')" != "" ]; then
|
|
||||||
RELEASENAME="$SNAPSHOTNAME"; PACKAGE="$SN_PACKAGE"
|
|
||||||
fi
|
|
||||||
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
|
|
||||||
if [ "$1" = "--show-result-path" ]; then echo "${RELEASEDIR_ROOT}/$PACKAGE"; exit 0
|
|
||||||
elif [ "$1" = "--show-result-path2" ]; then echo "${RELEASEDIR_ROOT}/$RELEASENAME"; exit 0; fi
|
|
||||||
|
|
||||||
echo "Creating binary package in $RELEASEDIR"
|
|
||||||
if [ "$SOURCE_BRANCH" != "" ]; then echo "Detected parameters for source repository: branch=[$SOURCE_BRANCH], commit=$SOURCE_COMMIT"; fi
|
|
||||||
|
|
||||||
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
|
|
||||||
mkdir -p "$RELEASEDIR"
|
|
||||||
|
|
||||||
if [ "$skipbinarybuild" -eq "0" ]; then
|
|
||||||
echo "building binaries ..."
|
|
||||||
cd "$CURRENTDIR"
|
|
||||||
if [ -d "build" ]; then rm -rf "build"; fi
|
|
||||||
build_command="./build-zg.sh -b"
|
|
||||||
if [ "$NUMCORES" != "" ]; then build_command="$build_command -c $NUMCORES"; fi
|
|
||||||
$build_command
|
|
||||||
if [ "$?" -ne "0" ]; then echo 'ERROR: "./build-zg.sh" failed.' >&2; exit 1; fi
|
|
||||||
else
|
|
||||||
echo "SKIPPING build of binaries ..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "$CURRENTDIR"
|
|
||||||
echo "copying binaries ..."
|
|
||||||
cp ../shared/*.ico "$RELEASEDIR"
|
|
||||||
if [ -e "$RELEASEDIR/zetaglest.ico" ]; then rm "$RELEASEDIR/zetaglest.ico"; fi
|
|
||||||
#cp bundle_resources/*.icns "$RELEASEDIR"
|
|
||||||
cp {../shared/,}*.ini "$RELEASEDIR"
|
|
||||||
if [ -e "$RELEASEDIR/glest-dev.ini" ]; then rm "$RELEASEDIR/glest-dev.ini"; fi
|
|
||||||
cp megaglest ../linux/start_megaglest_gameserver bundle_resources/MegaGlest.sh "$RELEASEDIR"
|
|
||||||
|
|
||||||
if [ -e "megaglest_editor" ]; then
|
|
||||||
cp megaglest_editor "$RELEASEDIR"
|
|
||||||
else
|
|
||||||
if [ -e "$RELEASEDIR/editor.ico" ]; then rm "$RELEASEDIR/editor.ico"; fi
|
|
||||||
fi
|
|
||||||
if [ -e "megaglest_g3dviewer" ]; then
|
|
||||||
cp megaglest_g3dviewer "$RELEASEDIR"
|
|
||||||
else
|
|
||||||
if [ -e "$RELEASEDIR/g3dviewer.ico" ]; then rm "$RELEASEDIR/g3dviewer.ico"; fi
|
|
||||||
fi
|
|
||||||
if [ -d "p7zip" ]; then cp -r p7zip "$RELEASEDIR"; fi
|
|
||||||
if [ -d "lib" ]; then cp -r lib "$RELEASEDIR"; fi
|
|
||||||
if [ "$(echo "$VERSION" | grep -v '\-dev$')" != "" ]; then
|
|
||||||
echo "$(date -u)" > "$RELEASEDIR/build-time.log"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" != "--installer" ]; then
|
|
||||||
echo "creating $PACKAGE"
|
|
||||||
cd "$RELEASEDIR_ROOT"
|
|
||||||
if [ -f "$PACKAGE" ]; then rm "$PACKAGE"; fi
|
|
||||||
cd "$RELEASENAME"
|
|
||||||
tar -cf - * | bzip2 -9 > "../$PACKAGE"
|
|
||||||
cd "$CURRENTDIR"
|
|
||||||
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "$CURRENTDIR"
|
|
||||||
if [ "$1" = "-CI" ] || [ "$1" = "-" ]; then
|
|
||||||
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
|
|
||||||
fi
|
|
@@ -1,59 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Use this script to build MegaGlest release archives for a Version Release
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# 2015 Written by filux <heross(@@)o2.pl>
|
|
||||||
# Copyright (c) 2015 under GNU GPL v3.0+
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
LANG=C
|
|
||||||
|
|
||||||
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
|
|
||||||
cd "$CURRENTDIR"
|
|
||||||
VERSION="$(../linux/mg-version.sh --version)"
|
|
||||||
kernel="macos"
|
|
||||||
|
|
||||||
RELEASENAME="MegaGlest-game-$kernel"
|
|
||||||
PACKAGE="$RELEASENAME-$VERSION.zip"
|
|
||||||
PACKAGE2="$RELEASENAME-$VERSION.dmg"
|
|
||||||
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
|
|
||||||
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
|
|
||||||
BINARY_DIR="$(./make-binary-archive.sh --show-result-path2)"
|
|
||||||
DATA_DIR="$(../linux/make-data-archive.sh --show-result-path2)"
|
|
||||||
APP_RES_DIR="$RELEASEDIR/MegaGlest.app/Contents/Resources"
|
|
||||||
APP_BIN_DIR="$RELEASEDIR/MegaGlest.app/Contents/MacOS"
|
|
||||||
APP_PLIST_DIR="$RELEASEDIR/MegaGlest.app/Contents"
|
|
||||||
APP_GAME_DIR="$APP_RES_DIR/megaglest-game"
|
|
||||||
|
|
||||||
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
|
|
||||||
mkdir -p "$APP_GAME_DIR"
|
|
||||||
mkdir -p "$APP_BIN_DIR"
|
|
||||||
|
|
||||||
./make-binary-archive.sh --installer
|
|
||||||
cp -r "$BINARY_DIR/"* "$APP_GAME_DIR"
|
|
||||||
../linux/make-data-archive.sh --installer
|
|
||||||
cp -r "$DATA_DIR/"* "$APP_GAME_DIR"; sleep 0.5s
|
|
||||||
if [ -f "$APP_GAME_DIR/MegaGlest.sh" ]; then rm -f "$APP_GAME_DIR/MegaGlest.sh"; fi
|
|
||||||
|
|
||||||
cp "$CURRENTDIR/build/mk/macos/bundle_resources/Info.plist" "$APP_PLIST_DIR"
|
|
||||||
cp "$CURRENTDIR/bundle_resources/MegaGlest.icns" "$APP_RES_DIR"
|
|
||||||
cp "$CURRENTDIR/bundle_resources/MegaGlest.sh" "$APP_BIN_DIR"
|
|
||||||
mv "$APP_BIN_DIR/MegaGlest.sh" "$APP_BIN_DIR/MegaGlest"
|
|
||||||
mv "$APP_GAME_DIR/lib" "$APP_GAME_DIR/Frameworks"; sleep 0.5s
|
|
||||||
mv "$APP_GAME_DIR/Frameworks" "$APP_PLIST_DIR/"
|
|
||||||
|
|
||||||
echo "creating $PACKAGE"
|
|
||||||
cd "$RELEASEDIR_ROOT"
|
|
||||||
if [ -f "$PACKAGE" ]; then rm -f "$PACKAGE"; fi
|
|
||||||
cd "$RELEASENAME"
|
|
||||||
zip -9r "../$PACKAGE" "MegaGlest.app" >/dev/null
|
|
||||||
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE"
|
|
||||||
|
|
||||||
echo "creating $PACKAGE2"
|
|
||||||
cd "$CURRENTDIR/build"
|
|
||||||
if [ -f "$RELEASEDIR_ROOT/$PACKAGE2" ]; then rm -f "$RELEASEDIR_ROOT/$PACKAGE2"; fi
|
|
||||||
cpack
|
|
||||||
mv -f MegaGlest*.dmg "$RELEASEDIR_ROOT"
|
|
||||||
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE2"
|
|
||||||
|
|
||||||
cd "$RELEASEDIR_ROOT"
|
|
||||||
find "${RELEASEDIR_ROOT}" -name "MegaGlest*" -type d | xargs rm -rf 2>/dev/null
|
|
||||||
find "${RELEASEDIR_ROOT}" -name "megaglest*" -type d | xargs rm -rf 2>/dev/null
|
|
1
mk/shared/glest-dev.ini
Normal file
1
mk/shared/glest-dev.ini
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DataPath=$APPLICATIONPATH/../../zetaglest-data/
|
@@ -2,34 +2,15 @@ temp notes file (-andy5995)
|
|||||||
|
|
||||||
# common options for Cmake prior to `make install`
|
# common options for Cmake prior to `make install`
|
||||||
|
|
||||||
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local \
|
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
|
||||||
-DZETAGLEST_DATA_INSTALL_PATH=$HOME/local/data/zetaglest \
|
|
||||||
-DZETAGLEST_BIN_INSTALL_PATH=games
|
|
||||||
|
|
||||||
Install the project...
|
To see other install locations, use `cmake .. -LH`. In many cases, just
|
||||||
-- Install configuration: "RelWithDebInfo"
|
using CMAKE_INSTALL_PREFIX will be sufficient
|
||||||
-- Up-to-date: /home/andy/local/bin/zetaglest
|
|
||||||
-- Installing: /home/andy/local/share/man/man6/zetaglest.6
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/start_zetaglest_gameserver
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/glestkeys.ini
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/servers.ini
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/glest.ini
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/zetaglest.ico
|
|
||||||
-- Installing: /home/andy/local/bin/zetaglest_editor
|
|
||||||
-- Installing: /home/andy/local/share/man/man6/zetaglest_editor.6
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/editor.ico
|
|
||||||
-- Installing: /home/andy/local/bin/zetaglest_g3dviewer
|
|
||||||
-- Installing: /home/andy/local/share/man/man6/zetaglest_g3dviewer.6
|
|
||||||
-- Installing: /home/andy/local/data/zetaglest/g3dviewer.ico
|
|
||||||
|
|
||||||
FIXME: If ZETAGLEST_BIN_INSTALL_PATH is an absolute path, it tries to install
|
|
||||||
/usr/local/bin
|
|
||||||
|
|
||||||
|
|
||||||
# generating the man page
|
# generating the man page
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770
|
COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770
|
||||||
${HELP2MAN} --name="3D multi-player real time strategy game" --section=6 -N -o
|
${HELP2MAN} --name="3D multi-player real time strategy game" --section=6 -N -o
|
||||||
${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
|
${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
|
||||||
@@ -37,3 +18,8 @@ ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
|
|||||||
ELSE()
|
ELSE()
|
||||||
add_custom_target(${TARGET_NAME_MANPAGE} ALL
|
add_custom_target(${TARGET_NAME_MANPAGE} ALL
|
||||||
COMMAND ${HELP2MAN} --name="${ZG_MANPAGE_DESCRIPTION}" --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
|
COMMAND ${HELP2MAN} --name="${ZG_MANPAGE_DESCRIPTION}" --section=6 -N -o ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE} ${HELP2MAN_OUT_PATH}${TARGET_NAME}
|
||||||
|
|
||||||
|
|
||||||
|
# Searcn and replace using 'git grep'
|
||||||
|
|
||||||
|
git grep -l 'original_text' | xargs sed -i 's/original_text/new_text/g'
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
mk/linux/zetaglest_editor
|
build/zetaglest_editor
|
||||||
mk/linux/zetaglest
|
build/zetaglest
|
||||||
mk/linux/zetaglest_g3dviewer
|
build/zetaglest_g3dviewer
|
||||||
source/tools/glexemel/g2xml
|
build/glexemel/g2xml
|
||||||
source/tools/glexemel/xml2g
|
build/glexemel/xml2g
|
||||||
|
@@ -25,8 +25,7 @@ Build-Depends:
|
|||||||
libwxgtk3.0-dev,
|
libwxgtk3.0-dev,
|
||||||
libxml2-dev,
|
libxml2-dev,
|
||||||
libz-dev,
|
libz-dev,
|
||||||
xauth,
|
xauth
|
||||||
xvfb
|
|
||||||
Standards-Version: 3.9.8
|
Standards-Version: 3.9.8
|
||||||
Homepage: https://github.com/ZetaGlest
|
Homepage: https://github.com/ZetaGlest
|
||||||
|
|
||||||
|
@@ -9,9 +9,7 @@ export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG
|
|||||||
|
|
||||||
override_dh_auto_configure:
|
override_dh_auto_configure:
|
||||||
dh_auto_configure -- \
|
dh_auto_configure -- \
|
||||||
-DZETAGLEST_BIN_INSTALL_PATH=games \
|
-DCMAKE_INSTALL_PREFIX=/usr
|
||||||
-DZETAGLEST_DATA_INSTALL_PATH=share/games/zetaglest/ \
|
|
||||||
-DWANT_DEV_OUTPATH=ON
|
|
||||||
|
|
||||||
override_dh_installchangelogs:
|
override_dh_installchangelogs:
|
||||||
dh_installchangelogs docs/CHANGELOG.txt
|
dh_installchangelogs docs/CHANGELOG.txt
|
||||||
|
354
scripts/start_zetaglest_gameserver
Executable file
354
scripts/start_zetaglest_gameserver
Executable file
@@ -0,0 +1,354 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Start a headless game server (and keep it running)
|
||||||
|
#
|
||||||
|
# Using this script, a headless game server is started, waiting for players to
|
||||||
|
# connect (if your firewall configuration permits). Players connect and start a
|
||||||
|
# game. As soon as the game ends, the server will quit, and this script will
|
||||||
|
# start up a new server again. This is a stability measure to rule out
|
||||||
|
# the unlikely case where side effects (such as memory leaks or corruption)
|
||||||
|
# could drain on system resources.
|
||||||
|
#
|
||||||
|
# For this to work, Internet originated traffic must be able to reach the
|
||||||
|
# server on the following ports:
|
||||||
|
# TCP port 61357: game protocol port
|
||||||
|
# TCP port 61358: FTP control port
|
||||||
|
# TCP ports 61359 to 61366: FTP data ports
|
||||||
|
#
|
||||||
|
# Once publishing to the master server succeeded (this can be verified at
|
||||||
|
# master server's site) you may connect to your headless game server
|
||||||
|
# using a copy of game you have installed on a Desktop computer. The first
|
||||||
|
# user connecting to a headless server controls it. If this user disconnects,
|
||||||
|
# the next user who connects (or had already connected) takes control.
|
||||||
|
#
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# 2013 Written by Tom Reynolds <tomreyn[at]zetaglest.org>
|
||||||
|
# 2015 Rewritten by filux <heross(@@)o2.pl>
|
||||||
|
# Copyright (c) 2013-2017 under GNU GPL v3.0+
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
LANG=C
|
||||||
|
trap "kill -- -$$" HUP INT QUIT TERM EXIT
|
||||||
|
|
||||||
|
KERNEL="$(uname -s | tr '[A-Z]' '[a-z]')"
|
||||||
|
if [ "$KERNEL" = "linux" ] || [ "$(echo "$(readlink -f "$0" >/dev/null 2>&1; echo $?)" | grep '^[0-9]$')" -eq "0" ]; then
|
||||||
|
GAMEDIR="$(dirname "$(readlink -f "$0")")"
|
||||||
|
else
|
||||||
|
GAMEDIR="$(cd "$(dirname "$0")"; pwd)"
|
||||||
|
fi
|
||||||
|
HOME_DIR="$HOME"
|
||||||
|
B_SCRIPT_DIR="$GAMEDIR"
|
||||||
|
|
||||||
|
# -------
|
||||||
|
# useful for mods
|
||||||
|
BASIC_SCRIPT="start_zetaglest"
|
||||||
|
FAKE_EXC_BINARY_MAC="ZetaGlest"
|
||||||
|
EXC_BINARY="zetaglest"
|
||||||
|
EXC_BINARY_DISTRO="zetaglest"
|
||||||
|
SHORT_GAME_NAME="zetaglest"
|
||||||
|
# -------
|
||||||
|
PORTSTART=62001
|
||||||
|
NUM_OM_SERVERS=2
|
||||||
|
NUM_OA_SERVERS=1
|
||||||
|
SERVER_HARDW_MAX_LOAD_PERC="100"
|
||||||
|
# Log file location (beware, this can grow large)
|
||||||
|
# LOG_SERVER=/dev/null
|
||||||
|
|
||||||
|
if [ "$(which curl 2>/dev/null)" = "" ]; then
|
||||||
|
echo "WARNING: Downloading tool 'curl' DOES NOT EXIST on this system, please install it." >&2
|
||||||
|
fi
|
||||||
|
if [ "$KERNEL" = "darwin" ]; then
|
||||||
|
if [ -e "$GAMEDIR/../../MacOS/$FAKE_EXC_BINARY_MAC" ]; then
|
||||||
|
BASIC_SCRIPT="$FAKE_EXC_BINARY_MAC"; B_SCRIPT_DIR="$(cd "${GAMEDIR}/../../MacOS/"; pwd)"
|
||||||
|
elif [ -e "$GAMEDIR/$FAKE_EXC_BINARY_MAC.sh" ]; then
|
||||||
|
BASIC_SCRIPT="$FAKE_EXC_BINARY_MAC.sh"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$(which lscpu 2>/dev/null)" != "" ]; then NUMCORES="$(lscpu -p | grep -cv '^#')"
|
||||||
|
elif [ "$(which sysctl 2>/dev/null)" != "" ]; then NUMCORES="$(sysctl -n hw.ncpu)"; fi
|
||||||
|
if [ "$NUMCORES" = "" ]; then NUMCORES=1; fi
|
||||||
|
echo "Notice: Detected processor with $NUMCORES cores." >&2
|
||||||
|
case $NUMCORES in
|
||||||
|
1) MAX_LOAD_MULT="0.65";; 2) MAX_LOAD_MULT="0.75";; 3) MAX_LOAD_MULT="0.82";;
|
||||||
|
4) MAX_LOAD_MULT="0.88";; 5) MAX_LOAD_MULT="0.92";; *) MAX_LOAD_MULT="0.95";;
|
||||||
|
esac
|
||||||
|
if [ "$SERVER_HARDW_MAX_LOAD_PERC" -gt "100" ]; then SERVER_HARDW_MAX_LOAD_PERC=100; fi
|
||||||
|
MAX_LOAD="$(echo "$NUMCORES $MAX_LOAD_MULT $SERVER_HARDW_MAX_LOAD_PERC" | awk '{print $1*$2*($3/100)}')"
|
||||||
|
|
||||||
|
if [ "$1" != "" ] && [ "$(echo "$1" | grep '^[0-9]\+$')" != "" ]; then SERVERCOUNT="$1"
|
||||||
|
else SERVERCOUNT=0; fi
|
||||||
|
if [ "$2" != "" ] && [ "$(echo "$2" | grep '[0-9.:]\+' | grep -v '[A-Za-z]')" != "" ]; then
|
||||||
|
SERVER_GREP_IP="$(echo "$2" | sed 's/\./\\./g')"; else SERVER_GREP_IP=""; fi
|
||||||
|
if [ "$3" != "" ] && [ "$(echo "$3" | grep '^[0-9]\+$')" != "" ]; then PORTSTART="$3"; fi
|
||||||
|
if [ "$4" != "" ]; then SERVERTITLE="$4"; fi
|
||||||
|
PORT="$(($PORTSTART + (($SERVERCOUNT - 1) * 11)))"; STATUSPORT="$(($PORT - 1))"
|
||||||
|
PORT_FD="$(echo "$PORT" | cut -c1-2)"; PORT_NLD="$((${#PORT} - ${#PORT_FD}))"
|
||||||
|
PORT_FDX="$PORT_FD"; c=1; while [ "$c" -le "$PORT_NLD" ]; do PORT_FDX="$(echo "${PORT_FDX}X")"; c="$(($c + 1))"; done
|
||||||
|
|
||||||
|
IDLE_TIME_MOD=12
|
||||||
|
if [ "$NUM_OA_SERVERS" -ge "$NUM_OM_SERVERS" ]; then NUM_OS_MOD="$NUM_OA_SERVERS"
|
||||||
|
else NUM_OS_MOD="$NUM_OM_SERVERS"; fi
|
||||||
|
if [ "$NUM_OS_MOD" -lt "3" ]; then NUM_OS_SMOD="$(($NUM_OS_MOD + 1))"
|
||||||
|
else NUM_OS_SMOD="$(($NUM_OS_MOD + ($NUM_OS_MOD / 3)))"; fi
|
||||||
|
if [ "$SERVERCOUNT" -ge "1" ]; then
|
||||||
|
IDLE_TIME_MOD="$((18 + ($NUM_OS_MOD * 2) - ($SERVERCOUNT * 2)))"
|
||||||
|
if [ "$IDLE_TIME_MOD" -lt "2" ]; then IDLE_TIME_MOD=2
|
||||||
|
elif [ "$IDLE_TIME_MOD" -gt "24" ]; then IDLE_TIME_MOD=24; fi
|
||||||
|
fi
|
||||||
|
MAX_IDLE_TIME="$(($IDLE_TIME_MOD * 3600))"
|
||||||
|
|
||||||
|
SERVER_SCRIPT="$(basename "$0")"
|
||||||
|
if [ -f "$GAMEDIR/glest.ini" ]; then
|
||||||
|
GLEST_INI="$(cat "$GAMEDIR/glest.ini" | sed -e 's:\$HOME:'"$HOME_DIR"':g')"
|
||||||
|
LOG_DIR="$(echo "$GLEST_INI" | grep '^LogPath=' | awk -F '=' '{print $2}')"
|
||||||
|
# e.g. on macos are problems with more advanced using awk ^
|
||||||
|
if [ "$LOG_DIR" != "" ] && [ "$(echo "$LOG_DIR" | grep '/$')" ]; then LOG_DIR="${LOG_DIR%?}"; fi
|
||||||
|
MASTER_SERVER="$(echo "$GLEST_INI" | grep '^Masterserver=' | awk -F '=' '{print $2}')"
|
||||||
|
if [ "$(echo "$MASTER_SERVER" | grep '/$')" ]; then CLEAR_M_SERVER="${MASTER_SERVER}showServersForGlest.php"
|
||||||
|
else CLEAR_M_SERVER="$MASTER_SERVER/showServersForGlest.php"; fi
|
||||||
|
if [ "$SERVERCOUNT" -gt "0" ]; then
|
||||||
|
USER_DATA_DIR="$(echo "$GLEST_INI" | grep '^UserData_Root=' | awk -F '=' '{print $2}')"
|
||||||
|
if [ "$USER_DATA_DIR" != "" ] && [ "$(echo "$USER_DATA_DIR" | grep '/$')" ]; then
|
||||||
|
USER_DATA_DIR="${USER_DATA_DIR%?}"
|
||||||
|
fi
|
||||||
|
if [ "$SERVERTITLE" = "" ] && [ -f "$USER_DATA_DIR/glestuser.ini" ]; then
|
||||||
|
GLEST_USER_INI="$(cat "$USER_DATA_DIR/glestuser.ini")"
|
||||||
|
SERVERNAME="$(echo "$GLEST_USER_INI" | grep '^NetPlayerName=' | awk -F '=' '{print $2}')"
|
||||||
|
if [ "$SERVERNAME" = "" ]; then SERVERNAME="Unknown"; fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [ "$SERVER_GREP_IP" != "" ]; then
|
||||||
|
echo "WARNING: file 'glest.ini' not found, maybe '$SERVER_SCRIPT' script is placed in the wrong location." >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
EXC_BINARY_FPID="$EXC_BINARY"; EXC_BINARY_DISTRO_W="$(which "$EXC_BINARY_DISTRO" 2>/dev/null)"
|
||||||
|
if [ -e "$B_SCRIPT_DIR/$BASIC_SCRIPT" ]; then SERVER_EXEC="$B_SCRIPT_DIR/$BASIC_SCRIPT"
|
||||||
|
elif [ -e "$GAMEDIR/$EXC_BINARY" ]; then SERVER_EXEC="$GAMEDIR/$EXC_BINARY"
|
||||||
|
else SERVER_EXEC="$EXC_BINARY_DISTRO_W"; EXC_BINARY_FPID="$EXC_BINARY_DISTRO"; fi
|
||||||
|
if [ "$SERVERCOUNT" -eq "0" ]; then
|
||||||
|
#if [ "$SERVER_EXEC" != "$EXC_BINARY_DISTRO_W" ]; then ulimit -c unlimited; fi
|
||||||
|
USED_PORTS=""; LOG_FILE="server.log"
|
||||||
|
RestartMarker="${SHORT_GAME_NAME}-server-restart.log"
|
||||||
|
else
|
||||||
|
USED_PORTS="--use-ports=$PORT,$PORT,$STATUSPORT "
|
||||||
|
RestartMarker="${SHORT_GAME_NAME}-server-restart-${PORT}.log"
|
||||||
|
WaitMarker="${SHORT_GAME_NAME}-server-wait-${PORT_FDX}.log"
|
||||||
|
LOG_FILE="server_${SERVERCOUNT}.log"
|
||||||
|
SERVERNAME="$SERVERNAME-${SERVERCOUNT}"
|
||||||
|
fi
|
||||||
|
SingleSMarker=".${SHORT_GAME_NAME}-server-single.log"
|
||||||
|
if [ "$LOG_DIR" != "" ]; then
|
||||||
|
if [ ! -f "$LOG_DIR/$SingleSMarker" ] && [ "$SERVERCOUNT" -le "1" ]; then
|
||||||
|
echo "#" > "$LOG_DIR/$SingleSMarker"; sleep 1s
|
||||||
|
elif [ -f "$LOG_DIR/$SingleSMarker" ] && [ "$SERVERCOUNT" -gt "1" ]; then
|
||||||
|
sleep 1s; rm -f "$LOG_DIR/$SingleSMarker"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$SERVERTITLE" = "" ] && [ "$SERVERNAME" != "" ]; then SERVERTITLE="$SERVERNAME"; fi
|
||||||
|
if [ "$SERVERCOUNT" -gt "0" ]; then
|
||||||
|
echo "Info: Server '$SERVERTITLE' nr. $SERVERCOUNT ($2 ; $PORT)." >&2
|
||||||
|
sleep "$(($SERVERCOUNT * 5))"s
|
||||||
|
fi
|
||||||
|
SER_PARAMETERS="--headless-server-mode=vps,exit"
|
||||||
|
#^ parameters without spaces and numbers inside
|
||||||
|
SER_GREP_PARAMETERS="$(echo "${USED_PORTS}$SER_PARAMETERS" | sed 's/--/\\--/g')"
|
||||||
|
|
||||||
|
if [ "$LOG_SERVER" != "" ]; then :
|
||||||
|
elif [ "$LOG_DIR" != "" ]; then
|
||||||
|
mkdir -p "$LOG_DIR"
|
||||||
|
LOG_SERVER="$LOG_DIR/$LOG_FILE"
|
||||||
|
else
|
||||||
|
LOG_SERVER=/dev/null
|
||||||
|
fi
|
||||||
|
cd "$GAMEDIR"
|
||||||
|
|
||||||
|
AVG_LOAD="unknown"; SER_SITUATION="unknown"; CHECK_AVG_LOAD_M=0
|
||||||
|
if [ -e "/proc/loadavg" ]; then CHECK_AVG_LOAD_M=1
|
||||||
|
elif [ "$(which sysctl 2>/dev/null)" != "" ]; then CHECK_AVG_LOAD_M=2; fi
|
||||||
|
while true; do
|
||||||
|
if [ "$LOG_SERVER" != "/dev/null" ] && [ -f "$LOG_SERVER" ] && [ "$(wc -c < "$LOG_SERVER")" -gt "250000" ]; then
|
||||||
|
mv -f "$LOG_SERVER" "$LOG_SERVER.1"; fi
|
||||||
|
if [ -e "core" ]; then mv -f "core" "core.1"; fi
|
||||||
|
date >> "$LOG_SERVER"
|
||||||
|
while true; do
|
||||||
|
if [ "$CHECK_AVG_LOAD_M" -eq "1" ]; then
|
||||||
|
AVG_LOAD="$(awk '{print $2}' /proc/loadavg)"
|
||||||
|
elif [ "$CHECK_AVG_LOAD_M" -eq "2" ]; then
|
||||||
|
AVG_LOAD="$(sysctl -n vm.loadavg | awk -F '{' '{print $2}' | awk '{print $2}')"
|
||||||
|
fi
|
||||||
|
if [ "$AVG_LOAD" != "unknown" ]; then
|
||||||
|
SER_SITUATION="$(echo "$AVG_LOAD $MAX_LOAD" | awk '{if ($1 > $2) print "highload"}')"
|
||||||
|
fi
|
||||||
|
if [ "$SER_SITUATION" = "highload" ]; then
|
||||||
|
if [ "$OLD_SER_SITUATION_STATUS" = "" ]; then
|
||||||
|
echo "WARNING: Detected high load on the server." >&2
|
||||||
|
OLD_SER_SITUATION_STATUS="yes"
|
||||||
|
fi
|
||||||
|
sleep 2.5m; sleep "$((RANDOM % 30))"s
|
||||||
|
else
|
||||||
|
OLD_SER_SITUATION_STATUS=""; NUM_O_FREE_SER=""
|
||||||
|
if [ "$LOG_DIR" != "" ] && [ ! -f "$LOG_DIR/$SingleSMarker" ]; then
|
||||||
|
if [ "$MASTER_SERVER" != "" ] && [ "$SERVER_GREP_IP" != "" ]; then
|
||||||
|
if [ "$WaitMarker" != "" ] && [ ! -f "$LOG_DIR/$WaitMarker" ]; then
|
||||||
|
echo "#" > "$LOG_DIR/$WaitMarker"; sleep 1s
|
||||||
|
fi
|
||||||
|
if [ -f "$LOG_DIR/$WaitMarker" ]; then
|
||||||
|
InWaitMarker="$(cat "$LOG_DIR/$WaitMarker" | tail -1 | grep '^[0-9]*$')"
|
||||||
|
if [ "$InWaitMarker" = "" ] || \
|
||||||
|
[ "$(find "$LOG_DIR/" -maxdepth 1 -name "$WaitMarker" -mmin +30)" ]; then
|
||||||
|
InWaitMarker=100; NUM_O_FREE_SER=103
|
||||||
|
fi
|
||||||
|
if [ "$SERVERCOUNT" -lt "$InWaitMarker" ]; then
|
||||||
|
echo "$SERVERCOUNT" >> "$LOG_DIR/$WaitMarker"; InWaitMarker="$SERVERCOUNT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -f "$LOG_DIR/$WaitMarker" ] && [ "$NUM_O_FREE_SER" != "103" ] && \
|
||||||
|
[ "$(($(date +%s)-$(date +%s -r "$LOG_DIR/$WaitMarker")))" -le "30" ]; then
|
||||||
|
NUM_O_FREE_SER=102
|
||||||
|
elif [ "$MASTER_SERVER" != "" ] && [ "$SERVER_GREP_IP" != "" ]; then
|
||||||
|
if [ "$SERVERCOUNT" -ne "$InWaitMarker" ]; then
|
||||||
|
NUM_O_FREE_SER=101
|
||||||
|
elif [ "$OLD_InWaitMarker" = "" ] || [ "$InWaitMarker" -ne "$OLD_InWaitMarker" ]; then
|
||||||
|
NUM_O_FREE_SER=100; OLD_InWaitMarker="$InWaitMarker"
|
||||||
|
fi
|
||||||
|
if [ "$NUM_O_FREE_SER" = "" ]; then
|
||||||
|
FIND_ALL_SER="$(curl -s -L "$CLEAR_M_SERVER")"; M_SERVER_STATUS="$?"
|
||||||
|
FIND_OUR_SER="$(echo "$FIND_ALL_SER" | grep '^\([^|]*|\)\{4\}'"$SERVER_GREP_IP"'|' \
|
||||||
|
| grep '^\([^|]*|\)\{11\}'"$PORT_FD"'[0-9]\{'"$PORT_NLD"'\}|')"
|
||||||
|
NUM_O_O_SER="$(echo "$FIND_OUR_SER" | wc -l)"
|
||||||
|
if [ "$NUM_O_O_SER" -eq "0" ]; then M_SERVER_STATUS=111; fi
|
||||||
|
if [ "$NUM_O_O_SER" != "" ] && [ "$NUM_O_O_SER" -lt "$NUM_OM_SERVERS" ]; then :
|
||||||
|
elif [ "$SERVERCOUNT" -le "$NUM_OS_SMOD" ]; then
|
||||||
|
NUM_O_FREE_SER="$(echo "$FIND_OUR_SER" | grep '^\([^|]*|\)\{10\}0|' -c)"
|
||||||
|
else
|
||||||
|
NUM_O_FREE_SER="$(echo "$FIND_OUR_SER" | grep '^\([^|]*|\)\{13\}0|' -c)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$NUM_O_FREE_SER" != "" ] && [ "$NUM_O_FREE_SER" -ge "$NUM_OA_SERVERS" ]; then
|
||||||
|
if [ "$OLD_NUM_OFS_STATUS" = "" ] && [ "$NUM_O_FREE_SER" -ne "100" ]; then
|
||||||
|
echo "Notice: Waiting for situation when server may be really needed." >&2
|
||||||
|
OLD_NUM_OFS_STATUS="yes"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$M_SERVER_STATUS" = "" ] || [ "$M_SERVER_STATUS" -eq "0" ] || [ "$SERVERCOUNT" -le "1" ]; then
|
||||||
|
OLD_NUM_OFS_STATUS=""
|
||||||
|
if [ -f "$LOG_DIR/$WaitMarker" ]; then echo "#" > "$LOG_DIR/$WaitMarker"; fi
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "WARNING: Detected some problems with connection to master server." >&2
|
||||||
|
M_SERVER_STATUS=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
sleep 32s
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$SERVERCOUNT" -eq "1" ] && [ ! -e "$GAMEDIR/${SHORT_GAME_NAME}-mini-update.sh" ] && \
|
||||||
|
[ -e "$GAMEDIR/../${SHORT_GAME_NAME}-dev_version-update.sh" ]; then
|
||||||
|
if [ ! -f "$GAMEDIR/${SHORT_GAME_NAME}-dev_version-update-done.log" ]; then
|
||||||
|
echo "... dev_version update:" >&2
|
||||||
|
"$GAMEDIR/../${SHORT_GAME_NAME}-dev_version-update.sh" "$GAMEDIR"; sleep 1s
|
||||||
|
echo "#" > "$GAMEDIR/${SHORT_GAME_NAME}-dev_version-update-done.log"; sleep 1s
|
||||||
|
#"$GAMEDIR/$SERVER_SCRIPT" "$@" &
|
||||||
|
#break
|
||||||
|
else
|
||||||
|
rm -f "$GAMEDIR/${SHORT_GAME_NAME}-dev_version-update-done.log"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo 'Starting server...' | tee -a "$LOG_SERVER"
|
||||||
|
|
||||||
|
if [ "$MASTER_SERVER" != "" ] && [ "$SERVER_GREP_IP" != "" ]; then
|
||||||
|
( check_nr=0; force_restart=0; loop_start="yes"; BeginTime="$(date +"%s")"; sleep 4m
|
||||||
|
while true; do
|
||||||
|
SER_PID="$(ps -ef | grep "[ \t/]$EXC_BINARY_FPID $SER_GREP_PARAMETERS" | grep -v 'grep' | awk '{print $2}')"
|
||||||
|
if [ "$loop_start" = "yes" ]; then SER_PID_S="$SER_PID"; loop_start="no"; fi
|
||||||
|
CheckTime="$(date +"%s")"; DiffTime="$(($CheckTime-$BeginTime))"
|
||||||
|
if [ "$SER_PID" != "" ] && [ "$SER_PID" = "$SER_PID_S" ]; then
|
||||||
|
FIND_SER="$(curl -s -L "$CLEAR_M_SERVER" | grep '^\([^|]*|\)\{4\}'"$SERVER_GREP_IP"'|' \
|
||||||
|
| grep '^\([^|]*|\)\{11\}'"$PORT"'|')"
|
||||||
|
if [ "$FIND_SER" = "" ]; then
|
||||||
|
check_nr="$(($check_nr + 1))"
|
||||||
|
if [ "$OLD_FIND_SER_STATUS" = "" ]; then
|
||||||
|
echo "WARNING: The master server doesn't see this server." >&2
|
||||||
|
OLD_FIND_SER_STATUS="yes"
|
||||||
|
elif [ "$check_nr" -eq "120" ]; then
|
||||||
|
echo "ERROR: The master server doesn't see this server for over 4 hours." >&2; force_restart=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
OLD_FIND_SER_STATUS=""
|
||||||
|
SER_STATUS="$(echo "$FIND_SER" | awk -F '|' '{print $14}')"
|
||||||
|
if [ "$SER_STATUS" = "" ] || [ "$(echo "$SER_STATUS" | grep '^[0-9]\+$')" = "" ]; then
|
||||||
|
echo "ERROR: Server status cannot be determined." >&2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$SER_STATUS" != "2" ] && [ "$DiffTime" -gt "$MAX_IDLE_TIME" ]; then
|
||||||
|
echo "Notice: The server is working continuously for over $IDLE_TIME_MOD hour(s)." >&2; force_restart=1
|
||||||
|
elif [ "$SER_STATUS" != "" ] && [ "$SER_STATUS" -eq "2" ]; then
|
||||||
|
if [ "$OLD_PROG_STATUS" = "" ]; then
|
||||||
|
echo "Status: Game in progress..." >&2
|
||||||
|
OLD_PROG_STATUS="yes"; BeginTime2="$(date +"%s")"
|
||||||
|
fi
|
||||||
|
DiffTime2="$(($CheckTime-$BeginTime2))"
|
||||||
|
if [ "$DiffTime2" -gt "14400" ]; then
|
||||||
|
echo "WARNING: The game is in progress for over 4 hours." >&2; force_restart=1
|
||||||
|
else
|
||||||
|
sleep 8m
|
||||||
|
fi
|
||||||
|
elif [ "$SER_STATUS" != "" ] && [ "$SER_STATUS" -eq "1" ]; then
|
||||||
|
if [ "$OLD_READY_STATUS" = "" ]; then
|
||||||
|
OLD_READY_STATUS="yes"; BeginTime3="$(date +"%s")"
|
||||||
|
fi
|
||||||
|
DiffTime3="$(($CheckTime-$BeginTime3))"
|
||||||
|
if [ "$DiffTime3" -gt "3600" ]; then
|
||||||
|
echo "WARNING: The game seems to waiting for start for over an hour." >&2; force_restart=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
OLD_READY_STATUS=""
|
||||||
|
fi
|
||||||
|
if [ "$SER_STATUS" != "" ] && [ "$SER_STATUS" -ne "2" ]; then OLD_PROG_STATUS=""; fi
|
||||||
|
if [ "$force_restart" -eq "1" ]; then
|
||||||
|
if [ "$check_nr" -lt "120" ]; then check_nr=120; fi
|
||||||
|
if [ "$LOG_DIR" != "" ]; then echo "#" > "$LOG_DIR/$RestartMarker"; sleep 2s; fi
|
||||||
|
if [ "$check_nr" -ge "123" ]; then kill -9 "$SER_PID"
|
||||||
|
else kill "$SER_PID"; fi
|
||||||
|
elif [ "$FIND_SER" != "" ]; then
|
||||||
|
check_nr=0
|
||||||
|
fi
|
||||||
|
sleep 2m
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
) &
|
||||||
|
fi
|
||||||
|
if [ "$SERVERTITLE" != "" ]; then
|
||||||
|
"$SERVER_EXEC" ${USED_PORTS}"$SER_PARAMETERS" --server-title="Headless (${SERVERTITLE})" >> "$LOG_SERVER" 2>&1
|
||||||
|
else
|
||||||
|
"$SERVER_EXEC" ${USED_PORTS}"$SER_PARAMETERS" >> "$LOG_SERVER" 2>&1
|
||||||
|
fi
|
||||||
|
if [ "$?" -ne "0" ]; then
|
||||||
|
if [ ! -f "$LOG_DIR/$RestartMarker" ]; then
|
||||||
|
echo 'ERROR: Server has quit unexpectedly.' >> "$LOG_SERVER"
|
||||||
|
echo 'ERROR: Server has quit unexpectedly.' >&2
|
||||||
|
if [ "$SERVERCOUNT" -eq "0" ]; then
|
||||||
|
echo ' Please inspect '"$LOG_SERVER"'.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 5s
|
||||||
|
if [ "$SERVERCOUNT" -eq "1" ] && [ -e "$GAMEDIR/${SHORT_GAME_NAME}-mini-update.sh" ] && \
|
||||||
|
[ "$SERVER_GREP_IP" != "" ] && [ "$MINI_UPDATE_USED" = "" ]; then
|
||||||
|
echo "... attempt to perform mini update, which may solve tiny problems:" >&2
|
||||||
|
"$GAMEDIR/${SHORT_GAME_NAME}-mini-update.sh"; sleep 1s
|
||||||
|
MINI_UPDATE_USED="yes"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo 'Notice: Server was restarted by script.' >> "$LOG_SERVER"
|
||||||
|
if [ "$LOG_DIR" != "" ]; then rm -f "$LOG_DIR/$RestartMarker"; fi
|
||||||
|
fi
|
||||||
|
sleep 2s
|
||||||
|
else
|
||||||
|
echo 'Server has quit.' | tee -a "$LOG_SERVER"
|
||||||
|
fi
|
||||||
|
done
|
@@ -1,12 +1,12 @@
|
|||||||
# common libraries
|
# common libraries
|
||||||
|
|
||||||
SET(EXTERNAL_LIBS "")
|
OPTION(BUILD_MODEL_VIEWER "Build model viewer" OFF)
|
||||||
SET(TARGET_NAME "zetaglest_g3dviewer")
|
SET(TARGET_NAME "zetaglest_g3dviewer")
|
||||||
SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
MESSAGE(STATUS "Build ${TARGET_NAME} = ${BUILD_MODEL_VIEWER}")
|
||||||
|
|
||||||
IF(BUILD_ZETAGLEST_MODEL_VIEWER)
|
|
||||||
MESSAGE(STATUS "Will try to build ZetaGlest model viewer")
|
|
||||||
|
|
||||||
|
IF(BUILD_MODEL_VIEWER)
|
||||||
|
SET(EXTERNAL_LIBS "")
|
||||||
|
SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
||||||
ADD_DEFINITIONS("-std=c++11")
|
ADD_DEFINITIONS("-std=c++11")
|
||||||
|
|
||||||
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
||||||
@@ -159,35 +159,29 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
INCLUDE_DIRECTORIES( ${GLEST_LIB_INCLUDE_ROOT}platform/${SDL_VERSION_SNAME} )
|
INCLUDE_DIRECTORIES( ${GLEST_LIB_INCLUDE_ROOT}platform/${SDL_VERSION_SNAME} )
|
||||||
|
|
||||||
SET(MG_SOURCE_FILES "../glest_game/graphics/particle_type.cpp" "../glest_game/graphics/unit_particle_type.cpp" "../glest_game/global/config.cpp")
|
SET(ZG_SOURCE_FILES "../glest_game/graphics/particle_type.cpp" "../glest_game/graphics/unit_particle_type.cpp" "../glest_game/global/config.cpp")
|
||||||
|
|
||||||
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
||||||
INCLUDE_DIRECTORIES( ${DIR} )
|
INCLUDE_DIRECTORIES( ${DIR} )
|
||||||
|
|
||||||
set(SRC_DIR_TO_GLOB ${DIR})
|
set(SRC_DIR_TO_GLOB ${DIR})
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
FILE(GLOB INCLUDE_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.h)
|
FILE(GLOB INCLUDE_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.h)
|
||||||
SET(MG_INCLUDE_FILES ${MG_INCLUDE_FILES} ${INCLUDE_FILES_FROM_THIS_DIR})
|
SET(ZG_INCLUDE_FILES ${ZG_INCLUDE_FILES} ${INCLUDE_FILES_FROM_THIS_DIR})
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
ENDFOREACH(DIR)
|
ENDFOREACH(DIR)
|
||||||
|
|
||||||
IF(WANT_DEV_OUTPATH)
|
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "${ZETAGLEST_FRIENDLY_OUTPUT_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MESSAGE(STATUS "\n***Note: The final output path for ZetaGlest G3d Viewer will be [${ZETAGLEST_BIN_OUTPUT_DIR}]\n")
|
ADD_EXECUTABLE(${TARGET_NAME} ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(${TARGET_NAME} ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})
|
|
||||||
|
|
||||||
IF(WANT_USE_STREFLOP AND NOT STREFLOP_FOUND)
|
IF(WANT_USE_STREFLOP AND NOT STREFLOP_FOUND)
|
||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} streflop)
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} streflop)
|
||||||
@@ -196,21 +190,18 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER)
|
|||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} libzetaglest)
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} libzetaglest)
|
||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
||||||
|
|
||||||
# Requires an install prefix for the items below to work
|
# Installation of the program
|
||||||
IF(NOT CMAKE_INSTALL_PREFIX STREQUAL "")
|
INSTALL(TARGETS
|
||||||
# Installation of the program
|
${TARGET_NAME}
|
||||||
INSTALL(TARGETS
|
DESTINATION "${INSTALL_DIR_BIN}")
|
||||||
${TARGET_NAME}
|
|
||||||
DESTINATION ${ZETAGLEST_BIN_OUTPUT_DIR})
|
|
||||||
|
|
||||||
# Installation of the program manpage file
|
# Installation of the program manpage file
|
||||||
INSTALL(FILES
|
INSTALL(FILES
|
||||||
"${PROJECT_SOURCE_DIR}/${TARGET_NAME_MANPAGE}"
|
"${PROJECT_SOURCE_DIR}/man/${TARGET_NAME_MANPAGE}"
|
||||||
DESTINATION ${ZETAGLEST_MANPAGE_INSTALL_PATH})
|
DESTINATION ${INSTALL_DIR_MAN})
|
||||||
|
|
||||||
# Installation of the program config and image files
|
# Installation of the program config and image files
|
||||||
INSTALL(FILES
|
INSTALL(FILES
|
||||||
"${PROJECT_SOURCE_DIR}/mk/shared/g3dviewer.ico"
|
"${PROJECT_SOURCE_DIR}/mk/shared/g3dviewer.ico"
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -6,9 +6,10 @@ SET(TARGET_NAME "zetaglest")
|
|||||||
SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
||||||
|
|
||||||
IF(BUILD_ZETAGLEST)
|
IF(BUILD_ZETAGLEST)
|
||||||
MESSAGE(STATUS "Will try to build ZetaGlest game")
|
MESSAGE(STATUS "Build ${TARGET_NAME} = YES")
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++11")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++11")
|
||||||
|
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
|
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
|
||||||
@@ -98,11 +99,11 @@ IF(BUILD_ZETAGLEST)
|
|||||||
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
IF(NOT OPENSSL_FOUND)
|
IF(NOT OPENSSL_FOUND)
|
||||||
# default
|
# default
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${CURL_LIBRARIES})
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${CURL_LIBRARIES})
|
||||||
ELSE()
|
ELSE()
|
||||||
# mageia
|
# mageia
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -112,73 +113,44 @@ IF(BUILD_ZETAGLEST)
|
|||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${GLEW_LIBRARIES})
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${GLEW_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(VLC_MIN_VERSION_ZG)
|
|
||||||
SET(LIBVLC_MIN_VERSION "${VLC_MIN_VERSION_ZG}")
|
find_package(PkgConfig REQUIRED)
|
||||||
|
IF(FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
|
pkg_search_module(STREFLOP streflop-soft)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(LIBVLC_MIN_VERSION "1.1.0")
|
IF(HAS_SSE_EXTENSIONS AND NOT ${FORCE_MAX_SSE_LEVEL} MATCHES "0")
|
||||||
ENDIF()
|
pkg_search_module(STREFLOP streflop-sse)
|
||||||
IF(WANT_USE_VLC)
|
|
||||||
FIND_PACKAGE(LIBVLC)
|
|
||||||
ENDIF()
|
|
||||||
IF(LIBVLC_FOUND AND NOT LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
|
|
||||||
MESSAGE(STATUS "**NOTE: LIBVLC found so intro videos are supported.")
|
|
||||||
INCLUDE_DIRECTORIES(${LIBVLC_INCLUDE_DIR})
|
|
||||||
IF(UNIX)
|
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LIBVLCCORE_LIBRARY} ${LIBVLC_LIBRARY})
|
|
||||||
ADD_DEFINITIONS(-DHAS_LIBVLC)
|
|
||||||
ENDIF()
|
|
||||||
IF(LIBVLC_VERSION_PRE_V2)
|
|
||||||
ADD_DEFINITIONS(-DLIBVLC_VERSION_PRE_2)
|
|
||||||
ENDIF()
|
|
||||||
IF(LIBVLC_VERSION_PRE_1_1_13)
|
|
||||||
ADD_DEFINITIONS(-DLIBVLC_VERSION_PRE_1_1_13)
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
IF(WANT_USE_VLC)
|
|
||||||
MESSAGE(STATUS "**WARNING: LIBVLC NOT found so videos are NOT supported.")
|
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "LIBVLC disabled so videos are NOT supported.")
|
IF(HAS_X87_SUPPORT)
|
||||||
|
pkg_search_module(STREFLOP streflop-x87)
|
||||||
|
ELSE()
|
||||||
|
pkg_search_module(STREFLOP streflop-soft)
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(NOT STREFLOP_FOUND)
|
||||||
|
pkg_search_module(STREFLOP streflop)
|
||||||
|
ENDIF()
|
||||||
|
MESSAGE(STATUS "Search for Library STREFLOP result = ${STREFLOP_FOUND} libs: ${STREFLOP_LIBRARIES} include dirs: ${STREFLOP_INCLUDE_DIRS}")
|
||||||
|
|
||||||
find_package(PkgConfig REQUIRED)
|
IF(FORCE_EMBEDDED_LIBS)
|
||||||
IF(FORCE_STREFLOP_SOFTWRAPPER)
|
SET(STREFLOP_FOUND OFF)
|
||||||
pkg_search_module(STREFLOP streflop-soft)
|
MESSAGE(STATUS "FORCING USE of EMBEDDED Libraries...")
|
||||||
ELSE()
|
ENDIF()
|
||||||
IF(HAS_SSE_EXTENSIONS AND NOT ${FORCE_MAX_SSE_LEVEL} MATCHES "0")
|
|
||||||
pkg_search_module(STREFLOP streflop-sse)
|
|
||||||
ELSE()
|
|
||||||
IF(HAS_X87_SUPPORT)
|
|
||||||
pkg_search_module(STREFLOP streflop-x87)
|
|
||||||
ELSE()
|
|
||||||
pkg_search_module(STREFLOP streflop-soft)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
IF(NOT STREFLOP_FOUND)
|
|
||||||
pkg_search_module(STREFLOP streflop)
|
|
||||||
ENDIF()
|
|
||||||
MESSAGE(STATUS "Search for Library STREFLOP result = ${STREFLOP_FOUND} libs: ${STREFLOP_LIBRARIES} include dirs: ${STREFLOP_INCLUDE_DIRS}")
|
|
||||||
|
|
||||||
IF(FORCE_EMBEDDED_LIBS)
|
IF(WANT_USE_STREFLOP)
|
||||||
SET(STREFLOP_FOUND OFF)
|
IF(STREFLOP_FOUND)
|
||||||
MESSAGE(STATUS "FORCING USE of EMBEDDED Libraries...")
|
INCLUDE_DIRECTORIES(${STREFLOP_INCLUDE_DIRS} ${STREFLOP_INCLUDE_DIRS}/streflop)
|
||||||
ENDIF()
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${STREFLOP_LIBRARIES})
|
||||||
|
ADD_DEFINITIONS("-DUSE_STREFLOP_PKG")
|
||||||
IF(WANT_USE_STREFLOP)
|
ENDIF()
|
||||||
IF(STREFLOP_FOUND)
|
ENDIF()
|
||||||
INCLUDE_DIRECTORIES(${STREFLOP_INCLUDE_DIRS} ${STREFLOP_INCLUDE_DIRS}/streflop)
|
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${STREFLOP_LIBRARIES})
|
|
||||||
|
|
||||||
ADD_DEFINITIONS("-DUSE_STREFLOP_PKG")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# zetaglest game
|
# zetaglest game
|
||||||
|
|
||||||
SET(DIRS_WITH_SRC
|
SET(DIRS_WITH_SRC
|
||||||
ai
|
ai
|
||||||
facilities
|
facilities
|
||||||
game
|
game
|
||||||
global
|
global
|
||||||
@@ -188,16 +160,16 @@ IF(BUILD_ZETAGLEST)
|
|||||||
menu
|
menu
|
||||||
network
|
network
|
||||||
sound
|
sound
|
||||||
steam
|
steam
|
||||||
steamshim
|
steamshim
|
||||||
type_instances
|
type_instances
|
||||||
types
|
types
|
||||||
world)
|
world)
|
||||||
|
|
||||||
SET(GLEST_LIB_INCLUDE_ROOT "../shared_lib/include/")
|
SET(GLEST_LIB_INCLUDE_ROOT "../shared_lib/include/")
|
||||||
SET(GLEST_LIB_INCLUDE_DIRS
|
SET(GLEST_LIB_INCLUDE_DIRS
|
||||||
${GLEST_LIB_INCLUDE_ROOT}compression
|
${GLEST_LIB_INCLUDE_ROOT}compression
|
||||||
${GLEST_LIB_INCLUDE_ROOT}platform/common
|
${GLEST_LIB_INCLUDE_ROOT}platform/common
|
||||||
${GLEST_LIB_INCLUDE_ROOT}platform/posix
|
${GLEST_LIB_INCLUDE_ROOT}platform/posix
|
||||||
${GLEST_LIB_INCLUDE_ROOT}util
|
${GLEST_LIB_INCLUDE_ROOT}util
|
||||||
${GLEST_LIB_INCLUDE_ROOT}graphics
|
${GLEST_LIB_INCLUDE_ROOT}graphics
|
||||||
@@ -206,7 +178,7 @@ IF(BUILD_ZETAGLEST)
|
|||||||
${GLEST_LIB_INCLUDE_ROOT}sound
|
${GLEST_LIB_INCLUDE_ROOT}sound
|
||||||
${GLEST_LIB_INCLUDE_ROOT}sound/openal
|
${GLEST_LIB_INCLUDE_ROOT}sound/openal
|
||||||
${GLEST_LIB_INCLUDE_ROOT}xml
|
${GLEST_LIB_INCLUDE_ROOT}xml
|
||||||
${GLEST_LIB_INCLUDE_ROOT}xml/rapidxml
|
${GLEST_LIB_INCLUDE_ROOT}xml/rapidxml
|
||||||
${GLEST_LIB_INCLUDE_ROOT}glew
|
${GLEST_LIB_INCLUDE_ROOT}glew
|
||||||
${GLEST_LIB_INCLUDE_ROOT}lua
|
${GLEST_LIB_INCLUDE_ROOT}lua
|
||||||
${GLEST_LIB_INCLUDE_ROOT}map)
|
${GLEST_LIB_INCLUDE_ROOT}map)
|
||||||
@@ -260,12 +232,6 @@ IF(BUILD_ZETAGLEST)
|
|||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-subsystem,console -mconsole")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-subsystem,console -mconsole")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(WANT_DEV_OUTPATH)
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "${ZETAGLEST_FRIENDLY_OUTPUT_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MESSAGE(STATUS "\n***Note: The final output path for the ZetaGlest engine will be [${ZETAGLEST_BIN_OUTPUT_DIR}]\n")
|
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
||||||
|
|
||||||
ADD_EXECUTABLE(${TARGET_NAME} ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
ADD_EXECUTABLE(${TARGET_NAME} ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
||||||
@@ -284,7 +250,7 @@ IF(BUILD_ZETAGLEST)
|
|||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES})
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES})
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "** WARNING: Could not find GoogleBreakpad. Disabling GoogleBreakpad support.")
|
message(STATUS "** MESSAGE: Could not find GoogleBreakpad. Disabling GoogleBreakpad support.")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -300,63 +266,54 @@ IF(BUILD_ZETAGLEST)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
||||||
|
|
||||||
IF (NOT ZG_CMAKE_INSTALL_PREFIX STREQUAL "")
|
# Installation of the program
|
||||||
SET(CMAKE_INSTALL_PREFIX "${ZG_CMAKE_INSTALL_PREFIX}")
|
INSTALL(TARGETS
|
||||||
|
${TARGET_NAME}
|
||||||
|
DESTINATION "${INSTALL_DIR_BIN}")
|
||||||
|
|
||||||
|
# Installation of the program manpage file
|
||||||
|
INSTALL(FILES
|
||||||
|
"${PROJECT_SOURCE_DIR}/man/${TARGET_NAME_MANPAGE}"
|
||||||
|
DESTINATION ${INSTALL_DIR_MAN})
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
INSTALL(PROGRAMS
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/linux/start_zetaglest_gameserver"
|
||||||
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
# Requires an install prefix for the items below to work
|
INSTALL(FILES
|
||||||
IF(NOT CMAKE_INSTALL_PREFIX STREQUAL "")
|
"${PROJECT_SOURCE_DIR}/mk/shared/glestkeys.ini"
|
||||||
MESSAGE(STATUS "**Source package INSTALL TRIGGERED [${PROJECT_SOURCE_DIR}]")
|
"${PROJECT_SOURCE_DIR}/mk/shared/servers.ini"
|
||||||
|
DESTINATION ${INSTALL_DIR_DATA})
|
||||||
# Installation of the program
|
IF(WIN32)
|
||||||
INSTALL(TARGETS
|
|
||||||
${TARGET_NAME}
|
|
||||||
DESTINATION "${ZETAGLEST_BIN_OUTPUT_DIR}")
|
|
||||||
|
|
||||||
# Installation of the program manpage file
|
|
||||||
INSTALL(FILES
|
INSTALL(FILES
|
||||||
"${PROJECT_SOURCE_DIR}/${TARGET_NAME_MANPAGE}"
|
"${PROJECT_SOURCE_DIR}/mk/windows/glest.ini"
|
||||||
DESTINATION ${ZETAGLEST_MANPAGE_INSTALL_PATH})
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
|
ELSEIF(UNIX AND NOT APPLE)
|
||||||
IF(UNIX)
|
|
||||||
INSTALL(PROGRAMS
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/linux/start_zetaglest_gameserver"
|
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
|
||||||
ENDIF()
|
|
||||||
INSTALL(FILES
|
INSTALL(FILES
|
||||||
"${PROJECT_SOURCE_DIR}/mk/shared/glestkeys.ini"
|
"${PROJECT_SOURCE_DIR}/mk/shared/glest.ini"
|
||||||
"${PROJECT_SOURCE_DIR}/mk/shared/servers.ini"
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
DESTINATION ${ZETAGLEST_DATA_INSTALL_PATH})
|
ELSEIF(UNIX AND APPLE)
|
||||||
IF(WIN32)
|
|
||||||
INSTALL(FILES
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/windows/glest.ini"
|
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
|
||||||
ELSEIF(UNIX AND NOT APPLE)
|
|
||||||
INSTALL(FILES
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/linux/glest.ini"
|
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
|
||||||
ELSEIF(UNIX AND APPLE)
|
|
||||||
INSTALL(FILES
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/macos/glest.ini"
|
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
|
||||||
IF(WANT_SINGLE_INSTALL_DIRECTORY AND EXISTS "${PROJECT_SOURCE_DIR}/mk/macos/p7zip/")
|
|
||||||
INSTALL(DIRECTORY
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/macos/p7zip"
|
|
||||||
DESTINATION ${ZETAGLEST_DATA_INSTALL_PATH})
|
|
||||||
ENDIF()
|
|
||||||
IF(WANT_SINGLE_INSTALL_DIRECTORY AND EXISTS "${PROJECT_SOURCE_DIR}/mk/macos/lib/")
|
|
||||||
INSTALL(DIRECTORY
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/macos/lib/"
|
|
||||||
DESTINATION "${ZETAGLEST_DATA_INSTALL_PATH}/../../Frameworks/")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
INSTALL(FILES
|
INSTALL(FILES
|
||||||
"${PROJECT_SOURCE_DIR}/mk/shared/zetaglest.ico"
|
"${PROJECT_SOURCE_DIR}/mk/shared/glest.ini"
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
IF(UNIX AND APPLE AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
|
|
||||||
INSTALL(FILES
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/macos/bundle_resources/MegaGlest.icns"
|
|
||||||
DESTINATION ${ZETAGLEST_ICON_INSTALL_PATH})
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
INSTALL(FILES
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/shared/zetaglest.ico"
|
||||||
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
|
IF(UNIX AND APPLE)
|
||||||
|
INSTALL(FILES
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/macos/bundle_resources/MegaGlest.icns"
|
||||||
|
DESTINATION ${INSTALL_DIR_ICON})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# These files must be in the same directory as the zetaglest binary
|
||||||
|
# when "make install" isn't used
|
||||||
|
#
|
||||||
|
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||||
|
COMMAND cp "${PROJECT_SOURCE_DIR}/mk/shared/glest.ini" "${CMAKE_BINARY_DIR}"
|
||||||
|
COMMAND cp "${PROJECT_SOURCE_DIR}/mk/shared/glestkeys.ini" "${CMAKE_BINARY_DIR}"
|
||||||
|
COMMAND cp "${PROJECT_SOURCE_DIR}/mk/shared/glest-dev.ini" "${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -221,19 +221,11 @@ namespace Glest {
|
|||||||
foundPath = tryCustomPath(cfgType, fileName, currentpath);
|
foundPath = tryCustomPath(cfgType, fileName, currentpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
#if defined(DATADIR)
|
||||||
if (foundPath == false) {
|
if (foundPath == false) {
|
||||||
foundPath =
|
foundPath =
|
||||||
tryCustomPath(cfgType, fileName,
|
tryCustomPath(cfgType, fileName,
|
||||||
formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
|
formatPath(TOSTRING(DATADIR)));
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CMAKE_INSTALL_PREFIX)
|
|
||||||
if (foundPath == false) {
|
|
||||||
foundPath =
|
|
||||||
tryCustomPath(cfgType, fileName,
|
|
||||||
formatPath(TOSTRING(CMAKE_INSTALL_PREFIX)));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -5735,10 +5735,10 @@ namespace
|
|||||||
}
|
}
|
||||||
PlatformExceptionHandler::disableBacktrace = disableBacktrace;
|
PlatformExceptionHandler::disableBacktrace = disableBacktrace;
|
||||||
|
|
||||||
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
#if defined(DATADIR)
|
||||||
if (SystemFlags::VERBOSE_MODE_ENABLED)
|
if (SystemFlags::VERBOSE_MODE_ENABLED)
|
||||||
printf("\n\nCUSTOM_DATA_INSTALL_PATH = [%s]\n\n",
|
printf("\n\nDATADIR = [%s]\n\n",
|
||||||
formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)).c_str());
|
formatPath(TOSTRING(DATADIR)).c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int
|
const int
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
# common libraries
|
# common libraries
|
||||||
|
|
||||||
SET(EXTERNAL_LIBS "")
|
OPTION(BUILD_MAP_EDITOR "Build map editor" OFF)
|
||||||
SET(TARGET_NAME "zetaglest_editor")
|
SET(TARGET_NAME "zetaglest_editor")
|
||||||
SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
MESSAGE(STATUS "Build ${TARGET_NAME} = ${BUILD_MAP_EDITOR}")
|
||||||
|
|
||||||
IF(BUILD_ZETAGLEST_MAP_EDITOR)
|
IF(BUILD_MAP_EDITOR)
|
||||||
MESSAGE(STATUS "Will try to build ZetaGlest map editor")
|
SET(EXTERNAL_LIBS "")
|
||||||
|
SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
|
||||||
ADD_DEFINITIONS("-std=c++11")
|
ADD_DEFINITIONS("-std=c++11")
|
||||||
|
|
||||||
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
||||||
@@ -139,35 +140,29 @@ IF(BUILD_ZETAGLEST_MAP_EDITOR)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
INCLUDE_DIRECTORIES( ${GLEST_LIB_INCLUDE_ROOT}platform/${SDL_VERSION_SNAME} )
|
INCLUDE_DIRECTORIES( ${GLEST_LIB_INCLUDE_ROOT}platform/${SDL_VERSION_SNAME} )
|
||||||
|
|
||||||
SET(MG_SOURCE_FILES "../glest_game/global/config.cpp")
|
SET(ZG_SOURCE_FILES "../glest_game/global/config.cpp")
|
||||||
|
|
||||||
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
||||||
INCLUDE_DIRECTORIES( ${DIR} )
|
INCLUDE_DIRECTORIES( ${DIR} )
|
||||||
|
|
||||||
set(SRC_DIR_TO_GLOB ${DIR})
|
set(SRC_DIR_TO_GLOB ${DIR})
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
FILE(GLOB INCLUDE_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.h)
|
FILE(GLOB INCLUDE_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.h)
|
||||||
SET(MG_INCLUDE_FILES ${MG_INCLUDE_FILES} ${INCLUDE_FILES_FROM_THIS_DIR})
|
SET(ZG_INCLUDE_FILES ${ZG_INCLUDE_FILES} ${INCLUDE_FILES_FROM_THIS_DIR})
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
ENDFOREACH(DIR)
|
ENDFOREACH(DIR)
|
||||||
|
|
||||||
IF(WANT_DEV_OUTPATH)
|
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "${ZETAGLEST_FRIENDLY_OUTPUT_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MESSAGE(STATUS "\n***Note: The final output path for ZetaGlest Map Editor will be [${ZETAGLEST_BIN_OUTPUT_DIR}]\n")
|
ADD_EXECUTABLE(${TARGET_NAME} ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(${TARGET_NAME} ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})
|
|
||||||
|
|
||||||
SET(MG_STREFLOP "")
|
SET(MG_STREFLOP "")
|
||||||
IF(WANT_USE_STREFLOP)
|
IF(WANT_USE_STREFLOP)
|
||||||
@@ -185,20 +180,18 @@ IF(BUILD_ZETAGLEST_MAP_EDITOR)
|
|||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} libzetaglest)
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} libzetaglest)
|
||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
||||||
|
|
||||||
# Requires an install prefix for the items below to work
|
# Installation of the program
|
||||||
IF(NOT CMAKE_INSTALL_PREFIX STREQUAL "")
|
INSTALL(TARGETS
|
||||||
# Installation of the program
|
${TARGET_NAME}
|
||||||
INSTALL(TARGETS
|
DESTINATION "${INSTALL_DIR_BIN}")
|
||||||
${TARGET_NAME}
|
# Installation of the program manpage file
|
||||||
DESTINATION ${ZETAGLEST_BIN_OUTPUT_DIR})
|
INSTALL(FILES
|
||||||
# Installation of the program manpage file
|
"${PROJECT_SOURCE_DIR}/man/${TARGET_NAME_MANPAGE}"
|
||||||
INSTALL(FILES
|
DESTINATION ${INSTALL_DIR_MAN})
|
||||||
"${PROJECT_SOURCE_DIR}/${TARGET_NAME_MANPAGE}"
|
|
||||||
DESTINATION ${ZETAGLEST_MANPAGE_INSTALL_PATH})
|
# Installation of the program config and image files
|
||||||
|
INSTALL(FILES
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/shared/editor.ico"
|
||||||
|
DESTINATION ${INSTALL_DIR_INI})
|
||||||
|
|
||||||
# Installation of the program config and image files
|
|
||||||
INSTALL(FILES
|
|
||||||
"${PROJECT_SOURCE_DIR}/mk/shared/editor.ico"
|
|
||||||
DESTINATION ${ZETAGLEST_INI_INSTALL_PATH})
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
OPTION(FORCE_EMBEDDED_LIBS "Force use of embedded libraries' code." OFF)
|
OPTION(FORCE_EMBEDDED_LIBS "Force use of embedded libraries' code." OFF)
|
||||||
|
|
||||||
|
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
|
||||||
|
|
||||||
# IMPORTANT: should come BEFORE finding packages
|
# IMPORTANT: should come BEFORE finding packages
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
IF(FORCE_STREFLOP_SOFTWRAPPER)
|
IF(FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
@@ -45,7 +47,7 @@ ENDIF()
|
|||||||
SET(EXTERNAL_LIBS "")
|
SET(EXTERNAL_LIBS "")
|
||||||
SET(TARGET_NAME "libzetaglest")
|
SET(TARGET_NAME "libzetaglest")
|
||||||
|
|
||||||
IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST)
|
IF(BUILD_MODEL_VIEWER OR BUILD_MAP_EDITOR OR BUILD_ZETAGLEST)
|
||||||
MESSAGE(STATUS "Building ZetaGlest shared library...")
|
MESSAGE(STATUS "Building ZetaGlest shared library...")
|
||||||
|
|
||||||
INCLUDE (CheckIncludeFiles)
|
INCLUDE (CheckIncludeFiles)
|
||||||
@@ -169,21 +171,20 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
FIND_PACKAGE(FTGL)
|
FIND_PACKAGE(FTGL)
|
||||||
IF(WANT_USE_FTGL)
|
IF(WANT_USE_FTGL)
|
||||||
if (FTGL_FOUND)
|
if (FTGL_FOUND)
|
||||||
MESSAGE(STATUS "**NOTE: FTGL font support was detected and enabled.")
|
MESSAGE(STATUS "**NOTE: FTGL font support was detected and enabled.")
|
||||||
|
ADD_DEFINITIONS(-DUSE_FTGL)
|
||||||
ADD_DEFINITIONS(-DUSE_FTGL)
|
INCLUDE_DIRECTORIES(${FTGL_INCLUDE_DIR})
|
||||||
INCLUDE_DIRECTORIES(${FTGL_INCLUDE_DIR})
|
IF(UNIX)
|
||||||
IF(UNIX)
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${FTGL_LIBRARY})
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${FTGL_LIBRARY})
|
ENDIF()
|
||||||
ENDIF()
|
|
||||||
else()
|
else()
|
||||||
MESSAGE("**NOTE: Warning! FTGL has been enabled but not detected. Your compilation will probably break. Turn off FTGL support by setting WANT_USE_FTGL to false, or visit http://ftgl.wiki.sourceforge.net/ for help on installing FTGL.")
|
MESSAGE("**NOTE: Warning! FTGL has been enabled but not detected. Your compilation will probably break. Turn off FTGL support by setting WANT_USE_FTGL to false, or visit http://ftgl.wiki.sourceforge.net/ for help on installing FTGL.")
|
||||||
endif()
|
endif()
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(FTGL_FOUND)
|
IF(FTGL_FOUND)
|
||||||
MESSAGE(STATUS "**NOTE: Warning: FTGL font support was detected but NOT enabled. You can enable it by setting WANT_USE_FTGL=true")
|
MESSAGE(STATUS "**NOTE: Warning: FTGL font support was detected but NOT enabled. You can enable it by setting WANT_USE_FTGL=true")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "**NOTE: Warning: FTGL font support was not detected. Visit http://ftgl.wiki.sourceforge.net/ for help on installing FTGL.")
|
MESSAGE(STATUS "**NOTE: Warning: FTGL font support was not detected. Visit http://ftgl.wiki.sourceforge.net/ for help on installing FTGL.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -201,37 +202,7 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${GLEW_LIBRARIES})
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${GLEW_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(VLC_MIN_VERSION_MG)
|
if(WANT_USE_FriBiDi)
|
||||||
SET(LIBVLC_MIN_VERSION "${VLC_MIN_VERSION_MG}")
|
|
||||||
ELSE()
|
|
||||||
SET(LIBVLC_MIN_VERSION "1.1.0")
|
|
||||||
ENDIF()
|
|
||||||
IF(WANT_USE_VLC)
|
|
||||||
FIND_PACKAGE(LIBVLC)
|
|
||||||
MESSAGE(STATUS "LIBVLC version: ${LIBVLC_VERSION}")
|
|
||||||
ENDIF()
|
|
||||||
IF(LIBVLC_FOUND AND NOT LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
|
|
||||||
MESSAGE(STATUS "**NOTE: LIBVLC found so videos are supported.")
|
|
||||||
INCLUDE_DIRECTORIES(${LIBVLC_INCLUDE_DIR})
|
|
||||||
IF(UNIX)
|
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LIBVLCCORE_LIBRARY} ${LIBVLC_LIBRARY})
|
|
||||||
ADD_DEFINITIONS(-DHAS_LIBVLC)
|
|
||||||
ENDIF()
|
|
||||||
IF(LIBVLC_VERSION_PRE_V2)
|
|
||||||
ADD_DEFINITIONS(-DLIBVLC_VERSION_PRE_2)
|
|
||||||
ENDIF()
|
|
||||||
IF(LIBVLC_VERSION_PRE_1_1_13)
|
|
||||||
ADD_DEFINITIONS(-DLIBVLC_VERSION_PRE_1_1_13)
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
IF(WANT_USE_VLC)
|
|
||||||
MESSAGE(STATUS "**WARNING: LIBVLC NOT found so videos are NOT supported.")
|
|
||||||
ELSE()
|
|
||||||
MESSAGE(STATUS "LIBVLC disabled so videos are NOT supported.")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
if(WANT_USE_FriBiDi)
|
|
||||||
find_package( FriBiDi )
|
find_package( FriBiDi )
|
||||||
if(FRIBIDI_FOUND)
|
if(FRIBIDI_FOUND)
|
||||||
add_definitions(-DHAVE_FRIBIDI)
|
add_definitions(-DHAVE_FRIBIDI)
|
||||||
@@ -253,7 +224,7 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
#SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES})
|
#SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES})
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "** WARNING: Could not find GoogleBreakpad. Disabling GoogleBreakpad support.")
|
message(STATUS "** Message: Could not find GoogleBreakpad. Disabling GoogleBreakpad support.")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -349,8 +320,8 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
|
|
||||||
SET(MG_INCLUDES_ROOT "include/")
|
SET(MG_INCLUDES_ROOT "include/")
|
||||||
SET(MG_SOURCES_ROOT "sources/")
|
SET(MG_SOURCES_ROOT "sources/")
|
||||||
SET(MG_INCLUDE_FILES "")
|
SET(ZG_INCLUDE_FILES "")
|
||||||
SET(MG_SOURCE_FILES "")
|
SET(ZG_SOURCE_FILES "")
|
||||||
INCLUDE_DIRECTORIES( ${MG_INCLUDES_ROOT}platform/${SDL_VERSION_SNAME} )
|
INCLUDE_DIRECTORIES( ${MG_INCLUDES_ROOT}platform/${SDL_VERSION_SNAME} )
|
||||||
INCLUDE_DIRECTORIES( ${MG_INCLUDES_ROOT}xml/rapidxml )
|
INCLUDE_DIRECTORIES( ${MG_INCLUDES_ROOT}xml/rapidxml )
|
||||||
INCLUDE_DIRECTORIES("sources/")
|
INCLUDE_DIRECTORIES("sources/")
|
||||||
@@ -375,7 +346,7 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
else()
|
else()
|
||||||
MESSAGE(STATUS "*** Using EMBEDDED libircclient because it was forced by option")
|
MESSAGE(STATUS "*** Using EMBEDDED libircclient because it was forced by option")
|
||||||
endif()
|
endif()
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/libircclient/src/libircclient.c)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/libircclient/src/libircclient.c)
|
||||||
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/source/shared_lib/sources/libircclient/include)
|
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/source/shared_lib/sources/libircclient/include)
|
||||||
else()
|
else()
|
||||||
MESSAGE(STATUS "*** Using libircclient found in [${IRCCLIENT_INCLUDE_DIR}] IRCCLIENT_FOUND [${IRCCLIENT_FOUND}] IRCCLIENT_LIBRARY [${IRCCLIENT_LIBRARY}]")
|
MESSAGE(STATUS "*** Using libircclient found in [${IRCCLIENT_INCLUDE_DIR}] IRCCLIENT_FOUND [${IRCCLIENT_FOUND}] IRCCLIENT_LIBRARY [${IRCCLIENT_LIBRARY}]")
|
||||||
@@ -412,20 +383,20 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
ADD_DEFINITIONS(-DLIBIRCCLIENT_PRE1_6)
|
ADD_DEFINITIONS(-DLIBIRCCLIENT_PRE1_6)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
else()
|
else()
|
||||||
message(STATUS "****WARNING DISABLING libircclient!!")
|
message(STATUS "****MESSAGE Disabling libircclient!!")
|
||||||
ADD_DEFINITIONS(-DDISABLE_IRCCLIENT)
|
ADD_DEFINITIONS(-DDISABLE_IRCCLIENT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/socket.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/socket.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/ircclient.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/ircclient.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/miniftpserver.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/miniftpserver.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/miniftpclient.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/miniftpclient.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/gl_wrap.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/gl_wrap.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/thread.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/thread.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/window.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/window.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/window_gl.cpp)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/${SDL_VERSION_SNAME}/window_gl.cpp)
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/win32_deps/src/glprocs.c)
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/win32_deps/src/glprocs.c)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
||||||
@@ -435,33 +406,33 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
#MESSAGE(STATUS "INCLUDE_DIR_TO_GLOB: ${INCLUDE_DIR_TO_GLOB}")
|
#MESSAGE(STATUS "INCLUDE_DIR_TO_GLOB: ${INCLUDE_DIR_TO_GLOB}")
|
||||||
FILE(GLOB INC_FILES_FROM_THIS_DIR ${INCLUDE_DIR_TO_GLOB}/*.h)
|
FILE(GLOB INC_FILES_FROM_THIS_DIR ${INCLUDE_DIR_TO_GLOB}/*.h)
|
||||||
#MESSAGE(STATUS "INCLUDE FILES GLOBBED: ${INC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "INCLUDE FILES GLOBBED: ${INC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_INCLUDE_FILES ${MG_INCLUDE_FILES} ${INC_FILES_FROM_THIS_DIR})
|
SET(ZG_INCLUDE_FILES ${ZG_INCLUDE_FILES} ${INC_FILES_FROM_THIS_DIR})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
||||||
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
|
|
||||||
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
||||||
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.c)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.c)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
ENDFOREACH(DIR)
|
ENDFOREACH(DIR)
|
||||||
|
|
||||||
#MESSAGE(STATUS "Source files: ${MG_INCLUDE_FILES}")
|
#MESSAGE(STATUS "Source files: ${ZG_INCLUDE_FILES}")
|
||||||
#MESSAGE(STATUS "Source files: ${MG_SOURCE_FILES}")
|
#MESSAGE(STATUS "Source files: ${ZG_SOURCE_FILES}")
|
||||||
#MESSAGE(STATUS "Include dirs: ${INCLUDE_DIRECTORIES}")
|
#MESSAGE(STATUS "Include dirs: ${INCLUDE_DIRECTORIES}")
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -472,17 +443,17 @@ IF(BUILD_ZETAGLEST_MODEL_VIEWER OR BUILD_ZETAGLEST_MAP_EDITOR OR BUILD_ZETAGLEST
|
|||||||
SET(PLATFORM_SPECIFIC_DEFINES "-DX11_AVAILABLE -DHAVE_SYS_IOCTL_H")
|
SET(PLATFORM_SPECIFIC_DEFINES "-DX11_AVAILABLE -DHAVE_SYS_IOCTL_H")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_SOURCE_FILES} PROPERTIES COMPILE_FLAGS
|
SET_SOURCE_FILES_PROPERTIES(${ZG_SOURCE_FILES} PROPERTIES COMPILE_FLAGS
|
||||||
"${PLATFORM_SPECIFIC_DEFINES} ${STREFLOP_PROPERTIES} ${CXXFLAGS}")
|
"${PLATFORM_SPECIFIC_DEFINES} ${STREFLOP_PROPERTIES} ${CXXFLAGS}")
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
||||||
|
|
||||||
IF(NOT WIN32)
|
IF(NOT WIN32)
|
||||||
ADD_LIBRARY(${TARGET_NAME} STATIC ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})
|
ADD_LIBRARY(${TARGET_NAME} STATIC ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
||||||
#MESSAGE(STATUS "Building shared game library as a STATIC library and saving to [${LIBRARY_OUTPUT_PATH}]")
|
#MESSAGE(STATUS "Building shared game library as a STATIC library and saving to [${LIBRARY_OUTPUT_PATH}]")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game)
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game)
|
||||||
ADD_LIBRARY(${TARGET_NAME} STATIC ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})
|
ADD_LIBRARY(${TARGET_NAME} STATIC ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
||||||
MESSAGE(STATUS "Building shared game library as a SHARED library and saving to [${LIBRARY_OUTPUT_PATH}]")
|
MESSAGE(STATUS "Building shared game library as a SHARED library and saving to [${LIBRARY_OUTPUT_PATH}]")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
@@ -216,11 +216,11 @@ namespace Shared {
|
|||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
string mg_icon_file = "";
|
string mg_icon_file = "";
|
||||||
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
#if defined(DATADIR)
|
||||||
if (fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)) + "megaglest.png")) {
|
if (fileExists(formatPath(TOSTRING(DATADIR)) + "megaglest.png")) {
|
||||||
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)) + "megaglest.png";
|
mg_icon_file = formatPath(TOSTRING(DATADIR)) + "megaglest.png";
|
||||||
} else if (fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)) + "megaglest.bmp")) {
|
} else if (fileExists(formatPath(TOSTRING(DATADIR)) + "megaglest.bmp")) {
|
||||||
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)) + "megaglest.bmp";
|
mg_icon_file = formatPath(TOSTRING(DATADIR)) + "megaglest.bmp";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -254,10 +254,10 @@ namespace Shared {
|
|||||||
mapTagReplacementValues["%%APPLICATIONPATH%%"] = Properties::applicationPath;
|
mapTagReplacementValues["%%APPLICATIONPATH%%"] = Properties::applicationPath;
|
||||||
mapTagReplacementValues["{APPLICATIONPATH}"] = Properties::applicationPath;
|
mapTagReplacementValues["{APPLICATIONPATH}"] = Properties::applicationPath;
|
||||||
|
|
||||||
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
#if defined(DATADIR)
|
||||||
mapTagReplacementValues["$APPLICATIONDATAPATH"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
|
mapTagReplacementValues["$APPLICATIONDATAPATH"] = formatPath(TOSTRING(DATADIR));
|
||||||
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
|
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = formatPath(TOSTRING(DATADIR));
|
||||||
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
|
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(DATADIR));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationDataPath;
|
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationDataPath;
|
||||||
@@ -387,10 +387,10 @@ namespace Shared {
|
|||||||
replaceAll(value, "%%APPLICATIONPATH%%", Properties::applicationPath);
|
replaceAll(value, "%%APPLICATIONPATH%%", Properties::applicationPath);
|
||||||
replaceAll(value, "{APPLICATIONPATH}", Properties::applicationPath);
|
replaceAll(value, "{APPLICATIONPATH}", Properties::applicationPath);
|
||||||
|
|
||||||
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
#if defined(DATADIR)
|
||||||
replaceAll(value, "$APPLICATIONDATAPATH", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
|
replaceAll(value, "$APPLICATIONDATAPATH", formatPath(TOSTRING(DATADIR)));
|
||||||
replaceAll(value, "%%APPLICATIONDATAPATH%%", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
|
replaceAll(value, "%%APPLICATIONDATAPATH%%", formatPath(TOSTRING(DATADIR)));
|
||||||
replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
|
replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(DATADIR)));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationDataPath);
|
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationDataPath);
|
||||||
|
@@ -5,7 +5,7 @@ SET(EXTERNAL_LIBS "")
|
|||||||
SET(TARGET_NAME "zetaglest_tests")
|
SET(TARGET_NAME "zetaglest_tests")
|
||||||
|
|
||||||
IF(BUILD_ZETAGLEST_TESTS)
|
IF(BUILD_ZETAGLEST_TESTS)
|
||||||
MESSAGE(STATUS "Will try to build ZetaGlest unit tests")
|
MESSAGE(STATUS "Build ${TARGET_NAME} = YES")
|
||||||
|
|
||||||
INCLUDE (CheckIncludeFiles)
|
INCLUDE (CheckIncludeFiles)
|
||||||
|
|
||||||
@@ -83,8 +83,8 @@ IF(BUILD_ZETAGLEST_TESTS)
|
|||||||
|
|
||||||
SET(MG_INCLUDES_ROOT "./")
|
SET(MG_INCLUDES_ROOT "./")
|
||||||
SET(MG_SOURCES_ROOT "./")
|
SET(MG_SOURCES_ROOT "./")
|
||||||
SET(MG_INCLUDE_FILES "")
|
SET(ZG_INCLUDE_FILES "")
|
||||||
SET(MG_SOURCE_FILES "")
|
SET(ZG_SOURCE_FILES "")
|
||||||
|
|
||||||
SET(GLEST_LIB_INCLUDE_ROOT "../shared_lib/include/")
|
SET(GLEST_LIB_INCLUDE_ROOT "../shared_lib/include/")
|
||||||
SET(GLEST_LIB_INCLUDE_DIRS
|
SET(GLEST_LIB_INCLUDE_DIRS
|
||||||
@@ -138,33 +138,33 @@ IF(BUILD_ZETAGLEST_TESTS)
|
|||||||
#MESSAGE(STATUS "INCLUDE_DIR_TO_GLOB: ${INCLUDE_DIR_TO_GLOB}")
|
#MESSAGE(STATUS "INCLUDE_DIR_TO_GLOB: ${INCLUDE_DIR_TO_GLOB}")
|
||||||
FILE(GLOB INC_FILES_FROM_THIS_DIR ${INCLUDE_DIR_TO_GLOB}/*.h)
|
FILE(GLOB INC_FILES_FROM_THIS_DIR ${INCLUDE_DIR_TO_GLOB}/*.h)
|
||||||
#MESSAGE(STATUS "INCLUDE FILES GLOBBED: ${INC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "INCLUDE FILES GLOBBED: ${INC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_INCLUDE_FILES ${MG_INCLUDE_FILES} ${INC_FILES_FROM_THIS_DIR})
|
SET(ZG_INCLUDE_FILES ${ZG_INCLUDE_FILES} ${INC_FILES_FROM_THIS_DIR})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
||||||
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.cpp)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
|
|
||||||
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
set(SRC_DIR_TO_GLOB ${MG_SOURCES_ROOT}${DIR})
|
||||||
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
#MESSAGE(STATUS "SRC_DIR_TO_GLOB: ${SRC_DIR_TO_GLOB}")
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.c)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.c)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.mm)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
FILE(GLOB SRC_FILES_FROM_THIS_DIR ${SRC_DIR_TO_GLOB}/*.m)
|
||||||
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
#MESSAGE(STATUS "SRC_FILES_FROM_THIS_DIR: ${SRC_FILES_FROM_THIS_DIR}")
|
||||||
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
SET(ZG_SOURCE_FILES ${ZG_SOURCE_FILES} ${SRC_FILES_FROM_THIS_DIR})
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
ENDFOREACH(DIR)
|
ENDFOREACH(DIR)
|
||||||
|
|
||||||
#MESSAGE(STATUS "Source files: ${MG_INCLUDE_FILES}")
|
#MESSAGE(STATUS "Source files: ${ZG_INCLUDE_FILES}")
|
||||||
#MESSAGE(STATUS "Source files: ${MG_SOURCE_FILES}")
|
#MESSAGE(STATUS "Source files: ${ZG_SOURCE_FILES}")
|
||||||
#MESSAGE(STATUS "Include dirs: ${INCLUDE_DIRECTORIES}")
|
#MESSAGE(STATUS "Include dirs: ${INCLUDE_DIRECTORIES}")
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -175,22 +175,16 @@ IF(BUILD_ZETAGLEST_TESTS)
|
|||||||
SET(PLATFORM_SPECIFIC_DEFINES "-DX11_AVAILABLE -DHAVE_SYS_IOCTL_H")
|
SET(PLATFORM_SPECIFIC_DEFINES "-DX11_AVAILABLE -DHAVE_SYS_IOCTL_H")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_SOURCE_FILES} PROPERTIES COMPILE_FLAGS
|
SET_SOURCE_FILES_PROPERTIES(${ZG_SOURCE_FILES} PROPERTIES COMPILE_FLAGS
|
||||||
"${PLATFORM_SPECIFIC_DEFINES} ${STREFLOP_PROPERTIES} ${CXXFLAGS}")
|
"${PLATFORM_SPECIFIC_DEFINES} ${STREFLOP_PROPERTIES} ${CXXFLAGS}")
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
||||||
|
|
||||||
IF(WANT_DEV_OUTPATH)
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "${ZETAGLEST_FRIENDLY_OUTPUT_PATH}")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
MESSAGE(STATUS "EXTERNAL_LIBS = [${EXTERNAL_LIBS}]")
|
MESSAGE(STATUS "EXTERNAL_LIBS = [${EXTERNAL_LIBS}]")
|
||||||
|
|
||||||
MESSAGE(STATUS "***Note: The final output path for the ZetaGlest engine will be [${EXECUTABLE_OUTPUT_PATH}]")
|
SET_SOURCE_FILES_PROPERTIES(${ZG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
|
ADD_EXECUTABLE(${TARGET_NAME} ${ZG_SOURCE_FILES} ${ZG_INCLUDE_FILES})
|
||||||
|
|
||||||
ADD_EXECUTABLE(${TARGET_NAME} ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})
|
|
||||||
|
|
||||||
IF(NOT WIN32)
|
IF(NOT WIN32)
|
||||||
IF(WANT_USE_STREFLOP AND NOT STREFLOP_FOUND)
|
IF(WANT_USE_STREFLOP AND NOT STREFLOP_FOUND)
|
||||||
@@ -199,20 +193,10 @@ IF(BUILD_ZETAGLEST_TESTS)
|
|||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} libzetaglest)
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} libzetaglest)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
||||||
IF(NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
|
|
||||||
# Run the unit tests after build
|
|
||||||
IF(EXISTS ${XVFB_EXEC})
|
|
||||||
MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} will run tests with it.")
|
|
||||||
|
|
||||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||||
COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${EXECUTABLE_OUTPUT_PATH}${TARGET_NAME}
|
COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET_NAME}"
|
||||||
COMMENT "***-- Found ZetaGlest test runner: ${TARGET_NAME} about to run unit tests via xvfb...")
|
COMMENT "***-- Found ZetaGlest test runner: ${TARGET_NAME} about to run unit tests...")
|
||||||
ELSE()
|
|
||||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
|
||||||
COMMAND ${EXECUTABLE_OUTPUT_PATH}${TARGET_NAME}
|
|
||||||
COMMENT "***-- Found ZetaGlest test runner: ${TARGET_NAME} about to run unit tests...")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -1,25 +1,23 @@
|
|||||||
# glexemel
|
# glexemel
|
||||||
|
|
||||||
IF(BUILD_ZETAGLEST_MODEL_IMPORT_EXPORT_TOOLS)
|
OPTION(BUILD_MODEL_IMPORT_EXPORT_TOOLS "Build model import/export tools" OFF)
|
||||||
MESSAGE(STATUS "Will try to build MegaGlest model import/export tools")
|
MESSAGE(STATUS "Build Model Import/Export Tools = ${BUILD_MODEL_IMPORT_EXPORT_TOOLS}")
|
||||||
|
|
||||||
OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF)
|
IF(BUILD_MODEL_IMPORT_EXPORT_TOOLS)
|
||||||
IF(WANT_DEV_OUTPATH)
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/source/tools/glexemel)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
add_executable(g2xml g2xml.c g3dv4.h)
|
add_executable(g2xml g2xml.c g3dv4.h)
|
||||||
|
|
||||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
string (FIND ${CMAKE_SYSTEM_NAME} "BSD" found_BSD)
|
||||||
SET(CMAKE_INCLUDE_PATH /usr/local/include)
|
IF (found_BSD)
|
||||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
SET(CMAKE_INCLUDE_PATH /usr/local/include)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
find_package(LibXml2)
|
find_package(LibXml2)
|
||||||
IF(LIBXML2_FOUND)
|
IF(LIBXML2_FOUND)
|
||||||
include_directories(${CMAKE_INCLUDE_PATH} ${LIBXML2_INCLUDE_DIR})
|
include_directories(${CMAKE_INCLUDE_PATH} ${LIBXML2_INCLUDE_DIR})
|
||||||
add_executable(xml2g xml2g.c g3dv4.h)
|
add_executable(xml2g xml2g.c g3dv4.h)
|
||||||
target_link_libraries(xml2g ${LIBXML2_LIBRARIES})
|
target_link_libraries(xml2g ${LIBXML2_LIBRARIES})
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "WARNING... xml2g will NOT be built since we cannot find libXml2 on this machine")
|
MESSAGE(STATUS "WARNING... xml2g will NOT be built since we cannot find libXml2 on this machine")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
Reference in New Issue
Block a user