From 902115a56f2529635b125642b584f41355151d93 Mon Sep 17 00:00:00 2001 From: Christian Kern Date: Thu, 26 Mar 2015 09:32:27 +0100 Subject: [PATCH] Fix compilation for newer CMake Versions (>= 3.1) --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5408e81..d90f696 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,25 @@ set (EMBB_BASE_VERSION_MAJOR 0) set (EMBB_BASE_VERSION_MINOR 2) set (EMBB_BASE_VERSION_PATCH 3) +# Fix compilation for CMake versions >= 3.1 +# +# New Policy 0054: +# CMake 3.1 and above no longer implicitly dereference variables +# or interpret keywords in an if() command argument when it is a +# Quoted Argument. +# See http://www.cmake.org/cmake/help/v3.1/policy/CMP0054.html +# +# New Policy 0053: +# CMake 3.1 introduced faster implementation of evaluation of the +# Variable References and Escape Sequences. This breaks compilation +# here. +# See http://www.cmake.org/cmake/help/v3.1/policy/CMP0053.html +# +# Set those policies to be treated the legacy (CMake < 3.1) way. +cmake_policy(SET CMP0054 OLD) +cmake_policy(SET CMP0053 OLD) + + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release -- libgit2 0.26.0