mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 07:01:21 +02:00
Updated build scripts
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
|
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
|
||||||
PROJECT( ZetaGlest )
|
PROJECT( ZetaGlest )
|
||||||
|
|
||||||
# The ZetaGlest CMakeLists is not supported on Windows. To compile on Windows, please use setup.bat in mk/windows
|
# The ZetaGlest CMakeLists is not supported on Windows. To compile on Windows, please use
|
||||||
#
|
# setup.bat in mk/windows
|
||||||
|
|
||||||
#SET(CMAKE_VERBOSE_MAKEFILE ON)
|
#SET(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
SET(CMAKE_INSTALL_PREFIX, "/usr")
|
||||||
|
|
||||||
# build type
|
# build type
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
@@ -72,7 +74,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
# For gcc warning options see: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
# For gcc warning options see: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||||
IF(NOT MINGW)
|
IF(NOT MINGW)
|
||||||
# For tons of verbose warnings add: -Wall
|
# For tons of verbose warnings add: -Wall
|
||||||
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rdynamic")
|
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -rDynamic")
|
||||||
# ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -rdynamic")
|
# ADD_DEFINITIONS("-Wuninitialized -Wsign-compare -Wunused-function -Wunused-variable -Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -rdynamic")
|
||||||
ELSE()
|
ELSE()
|
||||||
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -DUNICODE")
|
# ADD_DEFINITIONS("-Wreturn-type -fno-strict-aliasing -frounding-math -fsignaling-nans -mfpmath=sse -msse -DUNICODE")
|
||||||
@@ -151,16 +153,16 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Debug compiler flags
|
# Debug compiler flags
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3")
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -no-pie -fno-pie")
|
||||||
|
|
||||||
# Release compiler flags
|
# Release compiler flags
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 ")
|
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 -no-pie -fno-pie")
|
||||||
IF(NOT CMAKE_GENERATOR STREQUAL Xcode)
|
IF(NOT CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
|
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Release with debug info compiler flags
|
# Release with debug info compiler flags
|
||||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 ")
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -no-pie -fno-pie")
|
||||||
|
|
||||||
# Release minimum size compiler flags
|
# Release minimum size compiler flags
|
||||||
IF(NOT CMAKE_GENERATOR STREQUAL Xcode)
|
IF(NOT CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
@@ -196,8 +198,6 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
|
|
||||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" ZG_BUILD_TYPE)
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" ZG_BUILD_TYPE)
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS_{ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}}")
|
|
||||||
|
|
||||||
# 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 #
|
||||||
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}}")
|
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${ZG_BUILD_TYPE}}")
|
||||||
@@ -233,33 +233,6 @@ SET(SDL_VERSION_SNAME "sdl")
|
|||||||
# output binaries to the top level of the build directory
|
# output binaries to the top level of the build directory
|
||||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
IF(WIN32)
|
|
||||||
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
|
|
||||||
${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/wxWidgets-2.8.10/lib)
|
|
||||||
|
|
||||||
SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
|
|
||||||
${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
|
|
||||||
${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/lua-5.1/src
|
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b
|
|
||||||
${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141
|
|
||||||
${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/${SDL_WINDOWS_DIR_DINC}/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/xerces-c-src_2_8_0/lib)
|
|
||||||
link_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib)
|
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/source/win32_deps/Microsoft\ DirectX\ SDK \(November 2007\)/Include")
|
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854/include)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# Check if sources exist
|
# Check if sources exist
|
||||||
IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
|
IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
|
||||||
MESSAGE(STATUS "**Found game source code.")
|
MESSAGE(STATUS "**Found game source code.")
|
||||||
|
@@ -17,13 +17,13 @@ SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
|
|||||||
# './setupBuildDeps.sh --manually "Debian" "stable"' is for you.
|
# './setupBuildDeps.sh --manually "Debian" "stable"' is for you.
|
||||||
|
|
||||||
# Load shared functions
|
# Load shared functions
|
||||||
. $SCRIPTDIR/zg_shared.sh
|
. $SCRIPTDIR/detect-system.sh
|
||||||
|
|
||||||
# Got root?
|
# Got root?
|
||||||
if [ `id -u`'x' != '0x' ] && [ "$1" != "--manually" ]; then
|
#if [ `id -u`'x' != '0x' ] && [ "$1" != "--manually" ]; then
|
||||||
echo 'This script should be run as root (UID 0).' >&2
|
# echo 'This script should be run as root (UID 0).' >&2
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$(which git 2>/dev/null)" != "" ]; then
|
if [ "$(which git 2>/dev/null)" != "" ]; then
|
||||||
gitcommit="$(git log -1 --pretty=tformat:"%H" $SCRIPTDIR/../..)"
|
gitcommit="$(git log -1 --pretty=tformat:"%H" $SCRIPTDIR/../..)"
|
@@ -132,7 +132,7 @@ echo "CPU cores to be used: $NUMCORES"
|
|||||||
|
|
||||||
# Load shared functions
|
# Load shared functions
|
||||||
|
|
||||||
. $SCRIPTDIR/zg_shared.sh
|
. $SCRIPTDIR/detect-system.sh
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -318,13 +318,10 @@ else
|
|||||||
echo 'ERROR: MAKE failed.' >&2; exit 2
|
echo 'ERROR: MAKE failed.' >&2; exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git clone https://github.com/ZetaGlest/zetaglest-data.git
|
|
||||||
cd ..
|
cd ..
|
||||||
echo ''
|
echo ''
|
||||||
echo 'BUILD COMPLETE.'
|
echo 'BUILD COMPLETE.'
|
||||||
echo ''
|
echo ''
|
||||||
echo 'To launch ZetaGlest from the current directory, use:'
|
echo 'To launch ZetaGlest from the current directory, use:'
|
||||||
echo ' ./build/zetaglest'
|
echo ' ./zetaglest.sh'
|
||||||
#echo 'Or change into mk/linux and run it from there:'
|
|
||||||
#echo ' ./zetaglest --ini-path=./ --data-path=./'
|
|
||||||
fi
|
fi
|
@@ -4,5 +4,5 @@
|
|||||||
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||||
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
||||||
|
|
||||||
./setupBuildDeps.sh
|
./build-deps.sh
|
||||||
./build-zg-nosudo.sh
|
./build-zg-nodeps.sh
|
||||||
|
7
mk/linux/pull.sh
Executable file
7
mk/linux/pull.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd ../..
|
||||||
|
git pull
|
||||||
|
currentDir=$PWD
|
||||||
|
cd /usr/share/zetaglest
|
||||||
|
git pull
|
||||||
|
cd $currentDir
|
13
mk/linux/setup.sh
Executable file
13
mk/linux/setup.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Use this script to build ZetaGlest using cmake
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||||
|
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
||||||
|
|
||||||
|
currentDir=$PWD
|
||||||
|
cd /usr/share
|
||||||
|
git clone https://github.com/ZetaGlest/zetaglest-data.git zetaglest
|
||||||
|
cd $currentDir
|
||||||
|
./pull.sh
|
||||||
|
./build-zg.sh
|
||||||
|
chmod -R 777 build/
|
4
mk/linux/zetaglest.sh
Executable file
4
mk/linux/zetaglest.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
export DBUS_FATAL_WARNINGS=0
|
||||||
|
unset XMODIFIERS
|
||||||
|
./build/zetaglest
|
@@ -1 +1 @@
|
|||||||
DataPath=./zetaglest-data/
|
DataPath=/usr/share/zetaglest/
|
||||||
|
Reference in New Issue
Block a user