From 1763c31c3b964343b88f8f26dc2941dd8c0e1fbe Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Oct 2013 14:45:54 -0400 Subject: [PATCH] Set policy CMP0025 to NEW while building CMake itself CMake is aware of the policy's NEW behavior and the AppleClang compiler id. Set the policy to NEW explicitly to avoid the warning and get the NEW behavior. Also teach the RunCMake test infrastructure to build tests with -DCMAKE_POLICY_DEFAULT_CMP0025=NEW to avoid the policy warning in test output that must match specific regular expressions. --- CMakeLists.txt | 3 +++ Source/kwsys/CMakeLists.txt | 3 +++ Tests/RunCMake/RunCMake.cmake | 3 +++ Utilities/cmcurl/CMakeLists.txt | 3 +++ 4 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fbbe08a1..77b460440 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,9 @@ #============================================================================= cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR) set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required +if(POLICY CMP0025) + cmake_policy(SET CMP0025 NEW) +endif() project(CMake) if(CMAKE_BOOTSTRAP) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 0f2783689..a9d89d474 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -85,6 +85,9 @@ # written. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) +IF(POLICY CMP0025) + CMAKE_POLICY(SET CMP0025 NEW) +ENDIF() #----------------------------------------------------------------------------- # If a namespace is not specified, use "kwsys" and enable testing. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 00faa4ca7..6e58d6288 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -36,6 +36,9 @@ function(run_cmake test) if(NOT DEFINED RunCMake_TEST_OPTIONS) set(RunCMake_TEST_OPTIONS "") endif() + if(APPLE) + list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) + endif() execute_process( COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}" -G "${RunCMake_GENERATOR}" diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 74a713dd8..abf04d8b0 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -1,4 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) +IF(POLICY CMP0025) + CMAKE_POLICY(SET CMP0025 NEW) +ENDIF() PROJECT(LIBCURL C) # Setup package meta-data