+ make compiler check working for older cmake versions
This commit is contained in:
parent
27b4836d80
commit
3ceaf7acf9
|
@ -55,13 +55,19 @@ if(NOT ${BOOST_MIN_VERSION})
|
|||
set(BOOST_MIN_VERSION 1.48)
|
||||
endif()
|
||||
|
||||
# For older cmake versions the variable 'CMAKE_CXX_COMPILER_VERSION' is missing
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION)
|
||||
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION)
|
||||
|
||||
# Enabled C++11 for Freecad 0.17 and later
|
||||
IF(FREECAD_VERSION VERSION_GREATER 0.16)
|
||||
OPTION(BUILD_ENABLE_CXX11 "Enable C++11 support." ON)
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||
MESSAGE(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. G++ must be 4.7 or later")
|
||||
MESSAGE(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. G++ must be 4.7 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
ELSEIF(CMAKE_COMPILER_IS_CLANGXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
|
||||
MESSAGE(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. Clang must be 3.3 or later")
|
||||
MESSAGE(FATAL_ERROR "FreeCAD 0.17 and later requires C++11. Clang must be 3.3 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
ENDIF()
|
||||
ENDIF(FREECAD_VERSION VERSION_GREATER 0.16)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user