]> git.mxchange.org Git - flightgear.git/commitdiff
Better CMake policy detection
authorJames Turner <zakalawe@mac.com>
Tue, 10 Feb 2015 17:12:01 +0000 (17:12 +0000)
committerJames Turner <zakalawe@mac.com>
Tue, 10 Feb 2015 17:12:01 +0000 (17:12 +0000)
- thanks to Rebecca Palmer for suggesting this!

CMakeLists.txt

index 505538c1afd3921bff61957d2920cd91877e7f8c..ad1fb0fb901f19a1b65e8368fb58cf8966473632 100644 (file)
@@ -6,10 +6,12 @@ include (CheckCXXSourceCompiles)
 include (CheckIncludeFile)
 
 if(COMMAND cmake_policy)
-    if(${CMAKE_MAJOR_VERSION} GREATER 2) # version 3 or higher
-        cmake_policy(SET CMP0054 NEW)
-        cmake_policy(SET CMP0042 NEW)
-    endif()
+   if(POLICY CMP0054)
+       cmake_policy(SET CMP0054 NEW)
+   endif()
+   if(POLICY CMP0042)
+       cmake_policy(SET CMP0042 NEW)
+   endif()
 endif()
 
 # set this before project()