From a5a1e2b717a06c02f22815789f713983a81fa3f1 Mon Sep 17 00:00:00 2001 From: filux Date: Mon, 7 Dec 2015 17:20:58 +0100 Subject: [PATCH] tiny polishing related with gcc & wxWidgets --- mk/cmake/Modules/ReqVersAndStaticConf.cmake | 4 +++ source/g3d_viewer/CMakeLists.txt | 28 +++++++++++++-------- source/glest_map_editor/CMakeLists.txt | 19 ++++++++------ 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/mk/cmake/Modules/ReqVersAndStaticConf.cmake b/mk/cmake/Modules/ReqVersAndStaticConf.cmake index ae730264..f0f5100c 100644 --- a/mk/cmake/Modules/ReqVersAndStaticConf.cmake +++ b/mk/cmake/Modules/ReqVersAndStaticConf.cmake @@ -73,4 +73,8 @@ IF(STATIC_PNG) unset(_PNG_VERSION_SUFFIXES) ENDIF() +IF(STATIC_wxWidgets) + SET(wxWidgets_USE_STATIC ON) +ENDIF() + SET(VLC_MIN_VERSION_MG "1.1.0") diff --git a/source/g3d_viewer/CMakeLists.txt b/source/g3d_viewer/CMakeLists.txt index c3f3c1f8..744bdec2 100644 --- a/source/g3d_viewer/CMakeLists.txt +++ b/source/g3d_viewer/CMakeLists.txt @@ -10,10 +10,10 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER) IF(UNIX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.7 OR NOT "${CMAKE_CXX_COMPILER_VERSION}") ADD_DEFINITIONS("-std=gnu++0x") - ELSE() + ELSEIF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 5.1) ADD_DEFINITIONS("-std=c++11") ENDIF() - # Required at least on bsd and macos, on linux most likely not but we probably want to see same output on + # Was required at least on bsd and macos, on linux most likely not but we probably want to see same output on # linux too, e.g. deprecation warnings especially when newer than c++11 "standard" is on the way. ENDIF() @@ -31,20 +31,26 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${GLEW_LIBRARIES}) ENDIF() - IF(NOT WIN32) - IF(WANT_USE_XercesC) - FIND_PACKAGE(XercesC REQUIRED) - INCLUDE_DIRECTORIES(${XERCESC_INCLUDE}) + IF(WANT_USE_XercesC) + FIND_PACKAGE(XercesC REQUIRED) + INCLUDE_DIRECTORIES(${XERCESC_INCLUDE}) + IF(UNIX) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${XERCESC_LIBRARY}) - ENDIF() + ENDIF() + ENDIF() - # It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'. - FIND_PACKAGE(wxWidgets COMPONENTS core base gl REQUIRED) + # 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. + FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS gl core base) + IF(UNIX) # wxWidgets include (this will do all the magic to configure everything) - include( ${wxWidgets_USE_FILE} ) + INCLUDE( ${wxWidgets_USE_FILE} ) + SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${wxWidgets_LIBRARIES}) MESSAGE(STATUS " wxWidgets: ${wxWidgets_INCLUDE_DIRS} ;/; ${wxWidgets_LIBRARIES}") - ELSE() + ENDIF() + + IF(WIN32) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib/libwx_mswu-2.8-i586-mingw32msvc.dll.a) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib/libwx_mswu_gl-2.8-i586-mingw32msvc.dll.a) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib/libwxpng-2.8-i586-mingw32msvc.a) diff --git a/source/glest_map_editor/CMakeLists.txt b/source/glest_map_editor/CMakeLists.txt index e1bf4ad0..73b55bec 100644 --- a/source/glest_map_editor/CMakeLists.txt +++ b/source/glest_map_editor/CMakeLists.txt @@ -10,10 +10,10 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR) IF(UNIX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.7 OR NOT "${CMAKE_CXX_COMPILER_VERSION}") ADD_DEFINITIONS("-std=gnu++0x") - ELSE() + ELSEIF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 5.1) ADD_DEFINITIONS("-std=c++11") ENDIF() - # Required at least on bsd and macos, on linux most likely not but we probably want to see same output on + # Was required at least on bsd and macos, on linux most likely not but we probably want to see same output on # linux too, e.g. deprecation warnings especially when newer than c++11 "standard" is on the way. ENDIF() @@ -25,15 +25,18 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${OPENGL_LIBRARY}) - IF(NOT WIN32) - # It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'. - FIND_PACKAGE(wxWidgets COMPONENTS core base gl REQUIRED) - + # 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. + FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS gl core base) + IF(UNIX) # wxWidgets include (this will do all the magic to configure everything) - include( ${wxWidgets_USE_FILE} ) + INCLUDE( ${wxWidgets_USE_FILE} ) + SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${wxWidgets_LIBRARIES}) MESSAGE(STATUS " wxWidgets: ${wxWidgets_INCLUDE_DIRS} ;/; ${wxWidgets_LIBRARIES}") - ELSE() + ENDIF() + + IF(WIN32) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib/libwx_mswu-2.8-i586-mingw32msvc.dll.a) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib/libwx_mswu_gl-2.8-i586-mingw32msvc.dll.a) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${PROJECT_SOURCE_DIR}/source/win32_deps/wxWidgets-2.8.10/lib/libwxpng-2.8-i586-mingw32msvc.a)