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

Merge branch 'feature/retrigger-from-downstream-modules' into 'master'

[cmake] Retrigger code generation from downstream modules

See merge request dominic/dune-perftool!206
parents 51b7e26c e66541d2
No related branches found
No related tags found
No related merge requests found
...@@ -64,8 +64,14 @@ add_custom_target(generation) ...@@ -64,8 +64,14 @@ add_custom_target(generation)
if(CMAKE_PROJECT_NAME STREQUAL dune-perftool) if(CMAKE_PROJECT_NAME STREQUAL dune-perftool)
set(UFL2PDELAB_GLOB_PATTERN "${CMAKE_SOURCE_DIR}/python/*.py") set(UFL2PDELAB_GLOB_PATTERN "${CMAKE_SOURCE_DIR}/python/*.py")
else() else()
# TODO: How do we get to the source here??? dune_module_path(MODULE dune-perftool
message(WARNING "You are using dune-perftool from a downstream module. This may cause insufficient retriggers of code generation") RESULT perftool_path
CMAKE_MODULES)
dune_execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env python ${perftool_path}/perftool_sourcepath.py
OUTPUT_VARIABLE perftool_source
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(UFL2PDELAB_GLOB_PATTERN "${perftool_source}/*.py")
endif() endif()
file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN}) file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN})
......
# Find the actual sources of dune-perftool from downstream modules
# to define dependency on them (otherwise working on the form compiler
# becomes PITA). The cmake variable dune-perftool_DIR only points to the
# *build directory*, the source directory of upstream modules is not
# available through CMake (for good reason).
#
# Do not use this on your own, DunePerftoolMacros.cmake uses this!
import os
import sys
import dune.perftool
path = dune.perftool.__path__[0]
path = os.path.split(os.path.split(path)[0])[0]
sys.stdout.write(path)
sys.exit(0)
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