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

Allow usage of dune-perftool form downstream modules

parent 52e76619
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,7 @@ if(CMAKE_PROJECT_NAME STREQUAL dune-perftool)
set(UFL2PDELAB_GLOB_PATTERN "${CMAKE_SOURCE_DIR}/python/*.py")
else()
# TODO: How do we get to the source here???
message(WARNING "You are using dune-perftool from a downstream module. This may cause insufficient retriggers of code generation")
endif()
file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN})
......@@ -106,7 +107,10 @@ function(add_generated_executable)
endif()
# Write a standard main function
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/StandardMain.cmake ${GEN_MAIN})
dune_module_path(MODULE dune-perftool
RESULT perftool_path
CMAKE_MODULES)
configure_file(${perftool_path}/StandardMain.cmake ${GEN_MAIN})
add_custom_command(OUTPUT ${GEN_OPERATOR} ${GEN_DRIVER}
COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env ufl2pdelab
......@@ -115,7 +119,7 @@ function(add_generated_executable)
--driver-file ${GEN_DRIVER}
${GEN_FORM_COMPILER_ARGS}
--uflfile ${GEN_UFLFILE}
DEPENDS ${GEN_UFLFILE} ${UFL2PDELAB_SOURCES} ${GEN_DEPENDS}
DEPENDS ${GEN_UFLFILE} ${UFL2PDELAB_SOURCES} ${GEN_DEPENDS} ${DUNE_PERFTOOL_ADDITIONAL_PYTHON_SOURCES}
COMMENT "Running ufl2pdelab for the target ${GEN_TARGET}"
)
......
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