From 890fb39d25023aca7651c15f6ea46121ff842940 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Tue, 24 Mar 2015 18:28:59 -0400 Subject: [PATCH] - Apparently cmake_policy doesn't ignore unknown policies (which seems to defeat the purpose to me) so we must wrap them in code to detect if the policy is known. --- CMakeLists.txt | 8 ++++++-- CreateLaunchers.cmake | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c39a492e6..e3ee74d55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,12 @@ cmake_minimum_required( VERSION 2.4 ) project(ZDoom) if( COMMAND cmake_policy ) - cmake_policy( SET CMP0011 NEW ) - cmake_policy( SET CMP0054 NEW ) + if( POLICY CMP0011 ) + cmake_policy( SET CMP0011 NEW ) + endif( POLICY CMP0011 ) + if( POLICY CMP0054 ) + cmake_policy( SET CMP0054 NEW ) + endif( POLICY CMP0054 ) endif( COMMAND cmake_policy ) list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/CreateLaunchers.cmake b/CreateLaunchers.cmake index 83cc08b44..bd2b3e473 100644 --- a/CreateLaunchers.cmake +++ b/CreateLaunchers.cmake @@ -44,7 +44,9 @@ if(__create_launchers) endif() set(__create_launchers YES) -cmake_policy( SET CMP0026 OLD ) +if( POLICY CMP0026 ) + cmake_policy( SET CMP0026 OLD ) +endif( POLICY CMP0026 ) include(CleanDirectoryList)