From 455d190fd0691698f3ad2c12e7087023c294a2e7 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sat, 31 Jan 2015 20:51:36 +0100 Subject: [PATCH] CMakeLists: backwards compatibility with CMake < 3.0. --- contrib/zlib/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/zlib/CMakeLists.txt b/contrib/zlib/CMakeLists.txt index dd9e742ea..5a9546038 100644 --- a/contrib/zlib/CMakeLists.txt +++ b/contrib/zlib/CMakeLists.txt @@ -1,9 +1,12 @@ cmake_minimum_required(VERSION 2.4.4) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) -# use the old project command http://www.cmake.org/cmake/help/v3.0/policy/CMP0048.html +# CMake 3.0 changed the project command, setting policy CMP0048 reverts to the old behaviour. +# See http://www.cmake.org/cmake/help/v3.0/policy/CMP0048.html cmake_policy(PUSH) -cmake_policy(SET CMP0048 OLD) +if(CMAKE_MAJOR_VERSION GREATER 2) + cmake_policy(SET CMP0048 OLD) +endif() project(zlib C) cmake_policy(POP)