#
macro(deal_ii_invoke_autopilot)
+ message(STATUS "Autopilot invoked")
- # Generator specific values:
- if(CMAKE_GENERATOR MATCHES "Ninja")
- set(_make_command "$ ninja")
- else()
- set(_make_command " $ make")
- endif()
+ #
+ # Generate compile_commands.json
+ #
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
# Define and set up a compilation target:
add_executable(${TARGET} ${TARGET_SRC})
- deal_ii_setup_target(${TARGET})
+ target_link_libraries(${TARGET} dealii::dealii)
- message(STATUS "Autopilot invoked")
+ # Generator specific values:
+ if(CMAKE_GENERATOR MATCHES "Ninja")
+ set(_make_command "$ ninja")
+ else()
+ set(_make_command " $ make")
+ endif()
# Define a custom target to easily run the program:
if(NOT DEFINED TARGET_RUN)
set(_command
${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
)
-
else()
-
set(_command ${TARGET_RUN})
endif()
add_custom_target(run
COMMAND ${_command}
DEPENDS ${TARGET}
- COMMENT "Run ${TARGET} with ${CMAKE_BUILD_TYPE} configuration"
+ COMMENT "Run ${TARGET} with $<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug> configuration"
)
set(_run_targets
"# ${_make_command} run - to (compile, link and) run the program\n"
)
endif()
-
#
# Provide a target to sign the generated executable with a Mac OSX
# developer key. This avoids problems with an enabled firewall and MPI
endif()
#
- # Only mention release and debug targets if it is actually possible to
- # switch between them:
+ # And another custom target to clean up all files generated by the program:
#
- if(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease")
- set(_switch_targets
-"# ${_make_command} debug - to switch the build type to 'Debug'
-# ${_make_command} 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 "")
set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2)
endif()
COMMENT "runclean invoked"
)
+ #
# Define a distclean target to remove every generated file:
+ #
+
add_custom_target(distclean
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target runclean
COMMENT "distclean invoked"
)
+ #
# Define a strip_comments target:
+ #
+
find_package(Perl QUIET)
if(PERL_FOUND)
add_custom_target(strip_comments
)
endif()
+ #
+ # Construct help message:
+ #
+
+ # Only mention release and debug targets if it is actually possible to
+ # switch between them:
+ if(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease")
+ set(_switch_targets
+"# ${_make_command} debug - to switch the build type to 'Debug'
+# ${_make_command} release - to switch the build type to 'Release'\n"
+ )
+ endif()
- # Print out some usage information to file:
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake
"message(
\"###