summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd90163..8b41cc3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,21 @@ ENDIF(COMMAND CMAKE_POLICY)
MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
+IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
+ EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER}
+ ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ OUTPUT_VARIABLE _GXX_VERSION
+ )
+ STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+ _GXX_VERSION_SHORT ${_GXX_VERSION})
+ IF(_GXX_VERSION_SHORT EQUAL 33)
+ MESSAGE(FATAL_ERROR
+ "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
+ "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
+ "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
+ ENDIF()
+ENDIF()
+
# Allow empty endif() and such with CMake 2.4.
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)