From 84cbfb2e9861881bf29112f7b52ccb2b9f987d0d Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 9 Feb 2015 16:42:40 +0000 Subject: [PATCH] Cmake policies conditional on Cmake version. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c78c30b2..b1bc64b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required (VERSION 2.6.4) 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() include (CheckFunctionExists) -- 2.39.5