Skip to content
Snippets Groups Projects
Commit 1d4de4a4 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Merge branch 'feature/add-exclude-from-all-option' into 'master'

Feature/add exclude from all option

See merge request dominic/dune-perftool!219
parents 4dda6c0a 060560df
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
# Additional dependencies of the generated executable (changes in those # Additional dependencies of the generated executable (changes in those
# will retrigger generation) # will retrigger generation)
# #
# .. cmake_param:: EXCLUDE_FROM_ALL
# :option:
#
# Set this option, if you do not want the target to be automatically
# built. This option is forwarded to the builtin command add_executable.
#
# Add an executable to the project that gets automatically # Add an executable to the project that gets automatically
# generated at configure time with the form compiler uf2pdelab. # generated at configure time with the form compiler uf2pdelab.
# Regeneration is triggered correctly if the UFL file or the # Regeneration is triggered correctly if the UFL file or the
...@@ -65,7 +71,7 @@ endif() ...@@ -65,7 +71,7 @@ endif()
file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN}) file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN})
function(add_generated_executable) function(add_generated_executable)
set(OPTIONS) set(OPTIONS EXCLUDE_FROM_ALL)
set(SINGLE TARGET SOURCE UFLFILE INIFILE) set(SINGLE TARGET SOURCE UFLFILE INIFILE)
set(MULTI FORM_COMPILER_ARGS DEPENDS) set(MULTI FORM_COMPILER_ARGS DEPENDS)
include(CMakeParseArguments) include(CMakeParseArguments)
...@@ -108,6 +114,11 @@ function(add_generated_executable) ...@@ -108,6 +114,11 @@ function(add_generated_executable)
CMAKE_MODULES) CMAKE_MODULES)
configure_file(${perftool_path}/StandardMain.cmake ${GEN_SOURCE}) configure_file(${perftool_path}/StandardMain.cmake ${GEN_SOURCE})
endif() endif()
if(GEN_EXCLUDE_FROM_ALL)
set(GEN_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
else()
set(GEN_EXCLUDE_FROM_ALL "")
endif()
# Generate a list of generated headers to teach CMake about # Generate a list of generated headers to teach CMake about
dune_execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env python ${perftool_path}/deplist.py ${GEN_INIFILE} ${GEN_TARGET} dune_execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env python ${perftool_path}/deplist.py ${GEN_INIFILE} ${GEN_TARGET}
...@@ -125,7 +136,7 @@ function(add_generated_executable) ...@@ -125,7 +136,7 @@ function(add_generated_executable)
COMMENT "Generating operators for the target ${GEN_TARGET}" COMMENT "Generating operators for the target ${GEN_TARGET}"
) )
add_executable(${GEN_TARGET} ${GEN_SOURCE} ${GEN_DRIVER} ${header_deps}) add_executable(${GEN_TARGET} ${GEN_EXCLUDE_FROM_ALL} ${GEN_SOURCE} ${GEN_DRIVER} ${header_deps})
target_include_directories(${GEN_TARGET} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(${GEN_TARGET} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(generation ${GEN_TARGET}) add_dependencies(generation ${GEN_TARGET})
endfunction() endfunction()
......
...@@ -51,11 +51,9 @@ function(dune_add_formcompiler_system_test) ...@@ -51,11 +51,9 @@ function(dune_add_formcompiler_system_test)
UFLFILE ${SYSTEMTEST_UFLFILE} UFLFILE ${SYSTEMTEST_UFLFILE}
INIFILE "${CMAKE_CURRENT_BINARY_DIR}/${inifile}" INIFILE "${CMAKE_CURRENT_BINARY_DIR}/${inifile}"
DEPENDS ${SYSTEMTEST_INIFILE} DEPENDS ${SYSTEMTEST_INIFILE}
EXCLUDE_FROM_ALL
) )
# Exclude the target from all
set_property(TARGET ${tname} PROPERTY EXCLUDE_FROM_ALL 1)
# Add dependency on the metatarget for this systemtest # Add dependency on the metatarget for this systemtest
if(NOT ${INIINFO_${inifile}_suffix} STREQUAL "__empty") if(NOT ${INIINFO_${inifile}_suffix} STREQUAL "__empty")
add_dependencies(${SYSTEMTEST_BASENAME} ${tname}) add_dependencies(${SYSTEMTEST_BASENAME} ${tname})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment