]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Remove all "help" targets 104/head
authorMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Thu, 21 Aug 2014 17:10:48 +0000 (19:10 +0200)
committerMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Thu, 21 Aug 2014 17:28:34 +0000 (19:28 +0200)
It turns out that CMAKE_PROPERTY is too buggy to be useful. We cannot
set property CMP0037 to the old behavior in order to define a custom "help"
target in a macro without a warning. o_O

CMakeLists.txt
cmake/macros/macro_deal_ii_invoke_autopilot.cmake
cmake/setup_custom_targets.cmake

index 72bf5f2b0345eaf86cb45d1aa5c3e6946f3703e0..53308f72618174bcef0c05d9fea79b7cb77e9771 100644 (file)
 #
 # General configuration for cmake:
 #
+
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-IF(NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
-  CMAKE_POLICY(SET CMP0026 OLD) # enable target LOCATION property
-  CMAKE_POLICY(SET CMP0037 OLD) # allow to override the generic 'help' target
+
+IF(POLICY CMP0026)
+  # enable target LOCATION property
+  CMAKE_POLICY(SET CMP0026 OLD)
+ENDIF()
+
+IF(POLICY CMP0037)
+  # allow to override "test" target for quick tests
+  CMAKE_POLICY(SET CMP0037 OLD)
 ENDIF()
 
 MESSAGE(STATUS "This is CMake ${CMAKE_VERSION}")
index 8a25b89051fffb5da812dd50c61fbe2efb439ad7..a487d39b2c27210c2583dd682f7783a2e9d6fcd8 100644 (file)
 #                         empty
 #
 
-CMAKE_POLICY(PUSH)
-IF(NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
-  CMAKE_POLICY(SET CMP0037 OLD) # allow to override the generic 'help' target
-ENDIF()
-
 MACRO(DEAL_II_INVOKE_AUTOPILOT)
 
   # Generator specific values:
@@ -234,16 +229,6 @@ ${_switch_targets}#
     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake
     )
 
-  #
-  # In case of the Unix Makefiles generator it is safe to override the
-  # default 'help' target, which is - frankly - quite unhelpful.
-  #
-  IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-    ADD_CUSTOM_TARGET(help
-      COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake
-      )
-  ENDIF()
-
   # Print this message once:
   IF(NOT USAGE_PRINTED)
     INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake)
@@ -254,5 +239,3 @@ ${_switch_targets}#
 
 ENDMACRO()
 
-CMAKE_POLICY(POP)
-
index fcb3fbc127ca2bdc07f4261b6cf87a85d54d4178..c0323e86e23561c5d1b9e722d5d36328e802a391 100644 (file)
@@ -95,24 +95,10 @@ FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
 #    all            - compile the library and all enabled components
 #    clean          - remove all generated files
 #    install        - install into CMAKE_INSTALL_PREFIX
-")
-
-IF(CMAKE_GENERATOR MATCHES "Ninja")
-  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
-"#    info           - print this help message
+#    info           - print this help message
 #    help           - print a list of valid top level targets
 #
-")
-ELSE()
-  FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
-"#    info           - print this help message in the toplevel directory,
-#                     otherwise print a list of targets (in subdirectories)
-#
-")
-ENDIF()
-
-FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
-"#    edit_cache     - run ccmake for changing (cached) configuration variables
+#    edit_cache     - run ccmake for changing (cached) configuration variables
 #                     and reruns the configure and generate phases of CMake
 #    rebuild_cache  - rerun the configure and generate phases of CMake
 #
@@ -136,13 +122,3 @@ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
 ADD_CUSTOM_TARGET(info
   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
   )
-
-#
-# In case of the Unix Makefiles generator it is safe to override the
-# default 'help' target, which is - frankly - quite unhelpful.
-#
-IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-  ADD_CUSTOM_TARGET(help
-    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake
-    )
-ENDIF()

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.