From af0ccfadff37b7d32476b49f3512ece8be12c085 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 6 Jan 2015 11:38:12 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 15 ++++++++++----- cmake/setup_finalize.cmake | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0eb3066a4..4f2c02d7a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,14 +30,19 @@ # # General configuration for cmake: # -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - MESSAGE(STATUS "This is CMake ${CMAKE_VERSION}") MESSAGE(STATUS "") -IF(POLICY CMP0026) - # enable target LOCATION property - CMAKE_POLICY(SET CMP0026 OLD) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) + +# +# 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) 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 " -- 2.39.5