diff --git a/cmake/modules/DunePerftoolMacros.cmake b/cmake/modules/DunePerftoolMacros.cmake
index 074b5e5e22810ea2ac433c008244b5b751dafa60..66d0b4d7537b4ba44c69bfa4ebfd6b8fe9aae2c4 100644
--- a/cmake/modules/DunePerftoolMacros.cmake
+++ b/cmake/modules/DunePerftoolMacros.cmake
@@ -64,8 +64,14 @@ add_custom_target(generation)
 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")
+  dune_module_path(MODULE dune-perftool
+                   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()
 file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN})