- attempt to add support for static use of wxwidgets in tools
This commit is contained in:
parent
4425b7d234
commit
bdfb05a700
|
@ -37,6 +37,7 @@ OPTION(BUILD_MEGAGLEST "Build MegaGlest" ON)
|
||||||
OPTION(BUILD_MEGAGLEST_TESTS "Build MegaGlest Unit Tests" OFF)
|
OPTION(BUILD_MEGAGLEST_TESTS "Build MegaGlest 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_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_STATIC_WX_LIBS "Builds with static wxWidgets libs if possible." OFF)
|
||||||
OPTION(WANT_USE_VLC "Use libVLC to play videos." ON)
|
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)
|
||||||
|
@ -56,6 +57,7 @@ MARK_AS_ADVANCED(HELP2MAN XVFB_RUN)
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/mk/cmake/Modules/SpecialMacros.cmake)
|
include(${CMAKE_SOURCE_DIR}/mk/cmake/Modules/SpecialMacros.cmake)
|
||||||
include(${CMAKE_SOURCE_DIR}/mk/cmake/Modules/ReqVersAndStaticConf.cmake)
|
include(${CMAKE_SOURCE_DIR}/mk/cmake/Modules/ReqVersAndStaticConf.cmake)
|
||||||
|
MESSAGE(STATUS "=====================================================================")
|
||||||
|
|
||||||
SET(PKG_NAME "megaglest")
|
SET(PKG_NAME "megaglest")
|
||||||
# read version
|
# read version
|
||||||
|
|
|
@ -26,6 +26,14 @@ IF(WANT_STATIC_LIBS)
|
||||||
LIST(APPEND LIST_OF_STATIC_LIBS_MG "${STATIC_LIB}")
|
LIST(APPEND LIST_OF_STATIC_LIBS_MG "${STATIC_LIB}")
|
||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(WANT_STATIC_WX_LIBS AND (BUILD_MEGAGLEST_MODEL_VIEWER OR BUILD_MEGAGLEST_MAP_EDITOR OR BUILD_MEGAGLEST))
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets looking for STATIC libs.")
|
||||||
|
# wxWidgets for tools
|
||||||
|
FOREACH(STATIC_LIB
|
||||||
|
wxWidgets)
|
||||||
|
LIST(APPEND LIST_OF_STATIC_LIBS_MG "${STATIC_LIB}")
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
IF(BUILD_MEGAGLEST)
|
IF(BUILD_MEGAGLEST)
|
||||||
# only libs not used by shared lib
|
# only libs not used by shared lib
|
||||||
FOREACH(STATIC_LIB
|
FOREACH(STATIC_LIB
|
||||||
|
@ -75,6 +83,7 @@ ENDIF()
|
||||||
|
|
||||||
IF(STATIC_wxWidgets)
|
IF(STATIC_wxWidgets)
|
||||||
SET(wxWidgets_USE_STATIC ON)
|
SET(wxWidgets_USE_STATIC ON)
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets wanting STATIC libs.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(VLC_MIN_VERSION_MG "1.1.0")
|
SET(VLC_MIN_VERSION_MG "1.1.0")
|
||||||
|
|
|
@ -19,6 +19,7 @@ CMAKE_ONLY=0
|
||||||
MAKE_ONLY=0
|
MAKE_ONLY=0
|
||||||
CLANG_FORCED=0
|
CLANG_FORCED=0
|
||||||
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
|
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
|
||||||
|
WANT_STATIC_WX_LIBS="-DWANT_STATIC_WX_LIBS=OFF"
|
||||||
FORCE_EMBEDDED_LIBS=0
|
FORCE_EMBEDDED_LIBS=0
|
||||||
GCC_FORCED_VERSION=0
|
GCC_FORCED_VERSION=0
|
||||||
LUA_FORCED_VERSION=0
|
LUA_FORCED_VERSION=0
|
||||||
|
@ -26,7 +27,7 @@ FORCE_32BIT_CROSS_COMPILE=0
|
||||||
COMPILATION_WITHOUT=0
|
COMPILATION_WITHOUT=0
|
||||||
BUILD_MEGAGLEST_TESTS="ON"
|
BUILD_MEGAGLEST_TESTS="ON"
|
||||||
|
|
||||||
while getopts "c:defg:hl:mnwx" option; do
|
while getopts "c:defg:hl:mnswx" option; do
|
||||||
case "${option}" in
|
case "${option}" in
|
||||||
c)
|
c)
|
||||||
CPU_COUNT=${OPTARG}
|
CPU_COUNT=${OPTARG}
|
||||||
|
@ -60,6 +61,7 @@ while getopts "c:defg:hl:mnwx" option; do
|
||||||
echo " -l x : Force using LUA version x - example: -l 5.3"
|
echo " -l x : Force using LUA version x - example: -l 5.3"
|
||||||
echo " -m : Force running CMAKE only to create Make files (do not compile)"
|
echo " -m : Force running CMAKE only to create Make files (do not compile)"
|
||||||
echo " -n : Force running MAKE only to compile (assume CMAKE already built make files)"
|
echo " -n : Force running MAKE only to compile (assume CMAKE already built make files)"
|
||||||
|
echo " -s : Force compilation of wxWidgets STATIC libs"
|
||||||
echo " -w : Force compilation 'Without using wxWidgets'"
|
echo " -w : Force compilation 'Without using wxWidgets'"
|
||||||
echo " -x : Force cross compiling on x64 linux to produce an x86 32 bit binary"
|
echo " -x : Force cross compiling on x64 linux to produce an x86 32 bit binary"
|
||||||
|
|
||||||
|
@ -77,6 +79,10 @@ while getopts "c:defg:hl:mnwx" option; do
|
||||||
;;
|
;;
|
||||||
n)
|
n)
|
||||||
MAKE_ONLY=1
|
MAKE_ONLY=1
|
||||||
|
# echo "${option} value: ${OPTARG}"
|
||||||
|
;;
|
||||||
|
s)
|
||||||
|
WANT_STATIC_WX_LIBS="-DWANT_STATIC_WX_LIBS=ON"
|
||||||
# echo "${option} value: ${OPTARG}"
|
# echo "${option} value: ${OPTARG}"
|
||||||
;;
|
;;
|
||||||
w)
|
w)
|
||||||
|
@ -295,8 +301,8 @@ if [ "$COMPILATION_WITHOUT" != "0" ] && [ "$COMPILATION_WITHOUT" != "" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $MAKE_ONLY = 0 ]; then
|
if [ $MAKE_ONLY = 0 ]; then
|
||||||
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS} AND WANT_STATIC_LIBS = ${WANT_STATIC_LIBS} AND WANT_STATIC_WX_LIBS = ${WANT_STATIC_WX_LIBS}"
|
||||||
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON $WANT_STATIC_LIBS -DBUILD_MEGAGLEST_TESTS=$BUILD_MEGAGLEST_TESTS -DBREAKPAD_ROOT=$BREAKPAD_ROOT $EXTRA_CMAKE_OPTIONS ../../..
|
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON $WANT_STATIC_LIBS $WANT_STATIC_WX_LIBS -DBUILD_MEGAGLEST_TESTS=$BUILD_MEGAGLEST_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
|
||||||
|
|
|
@ -40,7 +40,16 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
|
||||||
|
|
||||||
# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.
|
# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.
|
||||||
# Optimal order most likely is gl > core > base, in some cases it may do difference.
|
# Optimal order most likely is gl > core > base, in some cases it may do difference.
|
||||||
|
IF(STATIC_wxWidgets)
|
||||||
|
SET(wxWidgets_USE_STATIC ON)
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets wanting STATIC libs.")
|
||||||
|
ENDIF()
|
||||||
FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS gl core base)
|
FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS gl core base)
|
||||||
|
IF(wxWidgets_USE_STATIC)
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets using STATIC libs: ${wxWidgets_LIBRARIES}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets NOT using STATIC libs: ${wxWidgets_LIBRARIES}")
|
||||||
|
ENDIF()
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
# wxWidgets include (this will do all the magic to configure everything)
|
# wxWidgets include (this will do all the magic to configure everything)
|
||||||
INCLUDE( ${wxWidgets_USE_FILE} )
|
INCLUDE( ${wxWidgets_USE_FILE} )
|
||||||
|
|
|
@ -186,6 +186,7 @@ IF(BUILD_MEGAGLEST)
|
||||||
menu
|
menu
|
||||||
network
|
network
|
||||||
sound
|
sound
|
||||||
|
steamshim
|
||||||
type_instances
|
type_instances
|
||||||
types
|
types
|
||||||
world)
|
world)
|
||||||
|
|
|
@ -26,7 +26,16 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR)
|
||||||
|
|
||||||
# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.
|
# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.
|
||||||
# Optimal order most likely is gl > core > base, in some cases it may do difference.
|
# Optimal order most likely is gl > core > base, in some cases it may do difference.
|
||||||
|
IF(STATIC_wxWidgets)
|
||||||
|
SET(wxWidgets_USE_STATIC ON)
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets wanting STATIC libs.")
|
||||||
|
ENDIF()
|
||||||
FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS gl core base)
|
FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS gl core base)
|
||||||
|
IF(wxWidgets_USE_STATIC)
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets using STATIC libs: ${wxWidgets_LIBRARIES}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "==========> wxWidgets NOT using STATIC libs: ${wxWidgets_LIBRARIES}")
|
||||||
|
ENDIF()
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
# wxWidgets include (this will do all the magic to configure everything)
|
# wxWidgets include (this will do all the magic to configure everything)
|
||||||
INCLUDE( ${wxWidgets_USE_FILE} )
|
INCLUDE( ${wxWidgets_USE_FILE} )
|
||||||
|
|
Loading…
Reference in New Issue