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

CMakeLists.txt

index b1bc64b2c2ddb2e14fcb8b749c9aeb368fb655d9..c9eb72943c5575bfd9c3eec00aa52b597374d0aa 100644 (file)
@@ -1,10 +1,12 @@
 cmake_minimum_required (VERSION 2.6.4)
 
 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()
 
 include (CheckFunctionExists)