From: James Turner Date: Mon, 9 Feb 2015 16:42:58 +0000 (+0000) Subject: Cmake policies conditional on Cmake version. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=891c8eaa9f9b35abc4c75e46be1f33ce541bd434;p=flightgear.git Cmake policies conditional on Cmake version. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index fa8f728b4..505538c1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,10 @@ include (CheckCXXSourceCompiles) include (CheckIncludeFile) 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() # set this before project()