From: Matthias Maier Date: Tue, 6 Jan 2015 10:38:12 +0000 (+0100) Subject: CMake: Explicitly set all policies to new behavior X-Git-Tag: v8.2.1~1^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c21e72120ed38efebaaa69853493bb78dadff43;p=dealii.git CMake: Explicitly set all policies to new behavior We support all CMake policies up to version 3.1.0 . Thus, set them to new behavior. Conflicts: CMakeLists.txt --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a2173045a..2c90ee2465 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2014 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -30,12 +30,18 @@ # # General configuration for cmake: # +MESSAGE(STATUS "This is CMake ${CMAKE_VERSION}") CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -IF(POLICY CMP0026) - # enable target LOCATION property - CMAKE_POLICY(SET CMP0026 OLD) +# +# We support all policy changes up to version 3.1.0. Thus, explicitly set +# all policies CMP0001 - CMP0054 to new for version 3.1 (and later) to +# avoid some unnecessary warnings. +# +IF( "${CMAKE_VERSION}" VERSION_EQUAL "3.1" OR + "${CMAKE_VERSION}" VERSION_GREATER "3.1" ) + CMAKE_POLICY(VERSION 3.1.0) ENDIF() IF(POLICY CMP0037) @@ -43,7 +49,6 @@ IF(POLICY CMP0037) CMAKE_POLICY(SET CMP0037 OLD) ENDIF() -MESSAGE(STATUS "This is CMake ${CMAKE_VERSION}") LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/ diff --git a/cmake/setup_finalize.cmake b/cmake/setup_finalize.cmake index a67101827b..e77431c982 100644 --- a/cmake/setup_finalize.cmake +++ b/cmake/setup_finalize.cmake @@ -1,6 +1,6 @@ ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2014 by the deal.II authors +## Copyright (C) 2012 - 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -40,7 +40,7 @@ ENDFOREACH() # used during the configuration stage: # FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) - IF(NOT "${_flag}" STREQUAL "") + IF(NOT "${${_flag}}" STREQUAL "") MESSAGE(FATAL_ERROR "\nInternal configuration error: The variable ${_flag} was set to a " "non empty value during the configuration! (The corresponding "