From: James Turner Date: Tue, 10 Feb 2015 17:12:01 +0000 (+0000) Subject: Better CMake policy detection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8c38cf5740eb75992e3d8444c2c631942cf0569d;p=flightgear.git Better CMake policy detection - thanks to Rebecca Palmer for suggesting this! --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 505538c1a..ad1fb0fb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()