]> 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>
Mon, 12 Jan 2015 22:21:58 +0000 (23:21 +0100)
We support all CMake policies up to version 3.1.0 . Thus, set them to new
behavior.

Conflicts:
CMakeLists.txt

CMakeLists.txt
cmake/setup_finalize.cmake

index 4a2173045a78f685df9a5fe87f79c2cb7bb449e9..2c90ee2465465c1d3b32fda11b43ebc99b6cb4b6 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.
 ##
 #
 # 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/
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.