From 02db183373f8112f95ed554e832d212ab2a52d7d Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Wed, 28 Oct 2015 20:19:49 +0100 Subject: [PATCH] cmake: Properly suppress CMake warning about qtmain CMake policy CMP0020 exists since version 2.8.11, so this prevents an error on older versions. This fixes up commit ec6f51b. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a25f5480b6..a87b049357 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0005 OLD) # Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION cmake_policy(SET CMP0006 NEW) + if(POLICY CMP0020) + cmake_policy(SET CMP0020 OLD) + endif() if(POLICY CMP0028) cmake_policy(SET CMP0028 OLD) endif() @@ -47,7 +50,6 @@ if(COMMAND cmake_policy) # COMPILE_DEFINITIONS are not used yet. Enable new behavior. cmake_policy(SET CMP0043 NEW) endif() - cmake_policy(SET CMP0020 OLD) endif() set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)