Fatal errors in CMake files (such as unsupported system) now abort the configuration step

This commit is contained in:
Laurent Gomila 2011-12-29 16:20:21 +01:00
parent effe6d4cec
commit c67148eaf2

View File

@ -14,12 +14,12 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW) EXEC_PROGRAM(/usr/bin/sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW)
STRING(REGEX REPLACE "10\\.([0-9]).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}") STRING(REGEX REPLACE "10\\.([0-9]).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}")
if(${MACOSX_VERSION} LESS 5) if(${MACOSX_VERSION} LESS 5)
message(WARNING "Unsupported version of OS X : ${MACOSX_VERSION_RAW}") message(FATAL_ERROR "Unsupported version of OS X : ${MACOSX_VERSION_RAW}")
return() return()
endif() endif()
else() else()
message(WARNING "Unsupported operating system") message(FATAL_ERROR "Unsupported operating system")
return() return()
endif() endif()
@ -32,7 +32,7 @@ if(${SIZEOF_VOID_PTR} MATCHES "^4$")
elseif(${SIZEOF_VOID_PTR} MATCHES "^8$") elseif(${SIZEOF_VOID_PTR} MATCHES "^8$")
set(ARCH_64BITS 1) set(ARCH_64BITS 1)
else() else()
message(WARNING "Unsupported architecture") message(FATAL_ERROR "Unsupported architecture")
return() return()
endif() endif()
@ -59,7 +59,7 @@ elseif(MSVC)
set(MSVC_VERSION 2010) set(MSVC_VERSION 2010)
endif() endif()
else() else()
message(WARNING "Unsupported compiler") message(FATAL_ERROR "Unsupported compiler")
return() return()
endif() endif()