]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Only provide appropriate switch targets in autopilot mode
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 9 Mar 2013 01:22:31 +0000 (01:22 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 9 Mar 2013 01:22:31 +0000 (01:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@28832 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake

index 19cbb7e0be17083ad5d611c2faf4d32f293b45b1..3b4260fc8fd30b4bab5b693aa3c92c66fbc114e8 100644 (file)
@@ -58,14 +58,24 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT)
       )
 
     # Define custom targets to easily switch the build type:
-    ADD_CUSTOM_TARGET(debug
-      COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
-      COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
-      )
-    ADD_CUSTOM_TARGET(release
-      COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
-      COMMENT "Switch CMAKE_BUILD_TYPE to Release"
-      )
+    IF(${DEAL_II_BUILD_TYPE} MATCHES "Debug")
+      ADD_CUSTOM_TARGET(debug
+        COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
+        COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
+        )
+      SET(_switch_targets
+        "#      $ make debug          - to switch the build type to \"Debug\"\n"
+        )
+    ENDIF()
+    IF(${DEAL_II_BUILD_TYPE} MATCHES "Release")
+      ADD_CUSTOM_TARGET(release
+        COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
+        COMMENT "Switch CMAKE_BUILD_TYPE to Release"
+        )
+      SET(_switch_targets ${_switch_targets}
+        "#      $ make release        - to switch the build type to \"Release\"\n"
+        )
+    ENDIF()
 
     # And another custom target to clean up all files generated by the program:
     IF("${CLEAN_UP_FILES}" STREQUAL "")
@@ -108,10 +118,9 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT)
 #  You can now run
 #      $ make                - to compile and link the program
 #      $ make run            - to (compile, link and) run the program
-#
-#      $ make debug          - to switch the build type to \"Debug\"
-#      $ make release        - to switch the build type to \"Release\"
-#      $ make edit_cache     - to change (cached) configuration variables
+#\n"
+${_switch_targets}
+"#      $ make edit_cache     - to change (cached) configuration variables
 #                              and rerun the configure and generate phases of CMake
 #
 #      $ make strip_comments - strip the source files in this

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.