]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Explicitly set all policies to new behavior
authorMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 6 Jan 2015 10:38:12 +0000 (11:38 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Tue, 6 Jan 2015 19:47:53 +0000 (20:47 +0100)
We support all CMake policies up to version 3.1.0 . Thus, set them to new
behavior.

CMakeLists.txt
cmake/setup_finalize.cmake

index e0eb3066a477dbe9ee1de08b099a5f71baf7fbea..4f2c02d7a8791f74769c853234c7761a8fd53365 100644 (file)
 #
 # 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)
index a67101827bb76b1ad6cf8e21db3cceda7a20d475..e77431c9829ec4e65650d19a4483b27beb0f8eb8 100644 (file)
@@ -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 "

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.