From: Matthias Maier Date: Sat, 9 Mar 2013 01:22:31 +0000 (+0000) Subject: CMake: Only provide appropriate switch targets in autopilot mode X-Git-Tag: v8.0.0~1049 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87198d57f20d71bcdfd4db2c41ab1160ebb53c08;p=dealii.git CMake: Only provide appropriate switch targets in autopilot mode git-svn-id: https://svn.dealii.org/trunk@28832 0785d39b-7218-0410-832d-ea1e28bc413d --- 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