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