|
|
@ -14,6 +14,33 @@ endif(CMAKE_CONFIGURATION_TYPES)
|
|
|
|
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
|
|
|
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
|
|
|
project(dfhack)
|
|
|
|
project(dfhack)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
macro(CHECK_GCC COMPILER_PATH)
|
|
|
|
|
|
|
|
execute_process(COMMAND ${COMPILER_PATH} -dumpversion OUTPUT_VARIABLE GCC_VERSION_OUT)
|
|
|
|
|
|
|
|
string(STRIP "${GCC_VERSION_OUT}" GCC_VERSION_OUT)
|
|
|
|
|
|
|
|
if (${GCC_VERSION_OUT} VERSION_LESS "4.5" OR ${GCC_VERSION_OUT} VERSION_GREATER "4.9.9")
|
|
|
|
|
|
|
|
message(SEND_ERROR "${COMPILER_PATH} version ${GCC_VERSION_OUT} cannot be used - use GCC 4.5 through 4.9")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
|
|
|
|
CHECK_GCC(${CMAKE_C_COMPILER})
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
message(SEND_ERROR "C compiler is not GCC")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
|
|
|
|
CHECK_GCC(${CMAKE_CXX_COMPILER})
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
message(SEND_ERROR "C++ compiler is not GCC")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
|
|
|
if(NOT MSVC)
|
|
|
|
|
|
|
|
message(SEND_ERROR "MSVC 2010 is required")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
if(MSVC)
|
|
|
|
# disable C4819 code-page warning
|
|
|
|
# disable C4819 code-page warning
|
|
|
|
add_definitions( "/wd4819" )
|
|
|
|
add_definitions( "/wd4819" )
|
|
|
|