# ${TARGET}
# TARGET_RUN - (optional) the command line that should be
# invoked by "make run", will be set to default
-# values if empty
+# values if undefined. If no run target should be
+# created, set it to an empty string.
# CLEAN_UP_FILES - (optional) a list of files (globs) that will be
# removed with "make runclean" and "make
# distclean", will be set to default values if
MESSAGE(STATUS "Autopilot invoked")
# Define a custom target to easily run the program:
- IF("${TARGET_RUN}" STREQUAL "")
+
+ IF(NOT DEFINED TARGET_RUN)
SET(TARGET_RUN ${TARGET})
ENDIF()
+
#
# Hack for Cygwin targets: Export PATH to point to the dynamic library.
# This is more or less harmless, so do this unconditionally.
#
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
- "SET(ENV{PATH} \"${DEAL_II_PATH}/${DEAL_II_LIBRARY_RELDIR}:\$ENV{PATH}\")\n"
- "EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_RUN}\n"
+ "SET(ENV{PATH} \"${CMAKE_CURRENT_BINARY_DIR}:${DEAL_II_PATH}/${DEAL_II_LIBRARY_RELDIR}:\$ENV{PATH}\")\n"
+ "EXECUTE_PROCESS(COMMAND ${TARGET_RUN}\n"
" RESULT_VARIABLE _return_value\n"
" )\n"
"IF(NOT \"\${_return_value}\" STREQUAL "0")\n"
" MESSAGE(SEND_ERROR \"\nProgram terminated with exit code: \${_return_value}\")\n"
"ENDIF()\n"
)
- ADD_CUSTOM_TARGET(run
- COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
- DEPENDS ${TARGET}
- COMMENT "Run ${TARGET} with ${CMAKE_BUILD_TYPE} configuration"
- )
+ IF(NOT "${TARGET_RUN}" STREQUAL "")
+ ADD_CUSTOM_TARGET(run
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
+ DEPENDS ${TARGET}
+ COMMENT "Run ${TARGET} with ${CMAKE_BUILD_TYPE} configuration"
+ )
+ SET(_run_targets
+ "# $ make run - to (compile, link and) run the program\n"
+ )
+ ENDIF()
# Define custom targets to easily switch the build type:
IF(${DEAL_II_BUILD_TYPE} MATCHES "Debug")
#
# You can now run
# $ make - to compile and link the program
-# $ make run - to (compile, link and) run the program
-#
+${_run_targets}#
${_switch_targets}#
# $ make edit_cache - to change (cached) configuration variables
# and rerun the configure and generate phases of CMake
runsteps_debug:= step-1 step-2 step-3 step-4 step-5 step-6 step-47
# Run all configuration independent steps in release configuration:
-runsteps_release= step-1 step-2 step-3 step-4 step-5 step-6 step-7 step-8 step-9 step-10 step-11 step-12 step-13 step-14 step-16 step-19 step-20 step-23 step-25 step-26 step-27 step-28 step-30 step-38 step-39 step-44 step-45 step-47 step-48 step-49
+runsteps_release= step-1 step-2 step-3 step-4 step-5 step-6 step-7 step-8 step-9 step-10 step-11 step-12 step-13 step-14 step-16 step-20 step-23 step-25 step-26 step-27 step-28 step-30 step-38 step-39 step-44 step-45 step-47 step-48 step-49
# step-15 step-21 step-24