From 78c784b52b1119f01cda8ca8c2372818a9dfca30 Mon Sep 17 00:00:00 2001 From: maier Date: Sat, 9 Mar 2013 01:22:31 +0000 Subject: [PATCH] CMake: Only provide appropriate switch targets in autopilot mode git-svn-id: https://svn.dealii.org/trunk@28832 0785d39b-7218-0410-832d-ea1e28bc413d --- .../macro_deal_ii_invoke_autopilot.cmake | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake index 19cbb7e0be..3b4260fc8f 100644 --- a/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake @@ -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 -- 2.39.5