]> git.mxchange.org Git - simgear.git/commitdiff
Cmake policies conditional on Cmake version.
authorJames Turner <zakalawe@mac.com>
Mon, 9 Feb 2015 16:42:40 +0000 (16:42 +0000)
committerJames Turner <zakalawe@mac.com>
Mon, 9 Feb 2015 16:42:40 +0000 (16:42 +0000)
CMakeLists.txt

index c78c30b2c279c706f33fed704919feeea358f551..b1bc64b2c2ddb2e14fcb8b749c9aeb368fb655d9 100644 (file)
@@ -1,8 +1,10 @@
 cmake_minimum_required (VERSION 2.6.4)
 
 if(COMMAND cmake_policy)
-    cmake_policy(SET CMP0054 NEW)
-    cmake_policy(SET CMP0042 NEW)
+    if(${CMAKE_MAJOR_VERSION} GREATER 2) # version 3 or higher
+        cmake_policy(SET CMP0054 NEW)
+        cmake_policy(SET CMP0042 NEW)
+    endif()
 endif()
 
 include (CheckFunctionExists)