Skip to content
Snippets Groups Projects
Verified Commit 5a6762cc authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Enable DUNE to append build directory to cmake prefix path

This allows super builds to be less verbose.
parent 6c054a7b
Branches
Tags
1 merge request!1517Enable DUNE to append build directory to cmake prefix path
Pipeline #77234 waiting for manual action
......@@ -34,6 +34,8 @@ Initialize and finalize a Dune module.
``CMakeLists.txt`` file. Among other things it creates the cmake package
configuration file and package version file. Modules can add additional
entries to these files by setting the variable ``${ProjectName}_INIT``.
When `DUNE_PROJECT_BINARY_DIR_IN_PREFIX_PATH` is set to `ON`, this
function will append the project binary directory to `CMAKE_PREFIX_PATH`.
Based on the template ``config.h.cmake`` in the project directory,
a private header file ``${module}-private-config.hh`` and a public header
......@@ -42,6 +44,17 @@ Initialize and finalize a Dune module.
configuration files is also created. For more information, see the build
system documentation.
Global options
^^^^^^^^^^^^^^
``DUNE_PROJECT_BINARY_DIR_IN_PREFIX_PATH``
When set to `ON`, the function `finalize_dune_project()` will append
the project binary directory to `CMAKE_PREFIX_PATH`. This is useful
for super builds where several modules are sub-directories of a cmake
(super) project and they depend on each other. In this way, subsequent
modules can find the build directory of a module when searched via
`find_package`.
#]=======================================================================]
include_guard(GLOBAL)
......@@ -225,6 +238,10 @@ macro(finalize_dune_project)
dune_symlink_to_source_tree()
endif()
if(DUNE_PROJECT_BINARY_DIR_IN_PREFIX_PATH)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR})
endif()
#configure all headerchecks
finalize_headercheck()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment