diff --git a/CMakeLists.txt b/CMakeLists.txt index a6ee30ce..45304204 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED( VERSION 2.6.2 ) +CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 ) PROJECT( MegaGlest ) #SET(CMAKE_VERBOSE_MAKEFILE ON) diff --git a/source/g3d_viewer/CMakeLists.txt b/source/g3d_viewer/CMakeLists.txt index 5dcf326f..3acd40b5 100644 --- a/source/g3d_viewer/CMakeLists.txt +++ b/source/g3d_viewer/CMakeLists.txt @@ -7,8 +7,12 @@ SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6") IF(BUILD_MEGAGLEST_MODEL_VIEWER) MESSAGE(STATUS "Will try to build MegaGlest model viewer") - IF(UNIX AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - ADD_DEFINITIONS("-std=c++11") + 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() + 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 # linux too, e.g. deprecation warnings especially when newer than c++11 "standard" is on the way. ENDIF() diff --git a/source/glest_map_editor/CMakeLists.txt b/source/glest_map_editor/CMakeLists.txt index 327a31ea..03f13bb1 100644 --- a/source/glest_map_editor/CMakeLists.txt +++ b/source/glest_map_editor/CMakeLists.txt @@ -7,8 +7,12 @@ SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6") IF(BUILD_MEGAGLEST_MAP_EDITOR) MESSAGE(STATUS "Will try to build MegaGlest map editor") - IF(UNIX AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - ADD_DEFINITIONS("-std=c++11") + 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() + 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 # linux too, e.g. deprecation warnings especially when newer than c++11 "standard" is on the way. ENDIF()