From 891c8eaa9f9b35abc4c75e46be1f33ce541bd434 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 9 Feb 2015 16:42:58 +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 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()