Skip to content
Snippets Groups Projects
Commit 6c71fff1 authored by Markus Blatt's avatar Markus Blatt
Browse files

Export whether module is installed with package configuration.

Variable ProjectName_INSTALLED can be used to query whether this
is an installed module or not.
E.g. this is necessary to adapt include paths for dune-uggrid.
parent 75538564
No related branches found
No related tags found
1 merge request!94Allow modules to customize cmake package configuration files
......@@ -821,6 +821,8 @@ macro(finalize_dune_project)
# Generate a standard cmake package configuration file
file(WRITE ${PROJECT_BINARY_DIR}/CMakeFiles/${ProjectName}-config.cmake.in
"if(NOT ${ProjectName}_FOUND)
# Whether this module is installed or not
set(${ProjectName}_INSTALLED @MODULE_INSTALLED@)
@PACKAGE_INIT@
#report other information
......@@ -866,6 +868,7 @@ endif()")
# Set the location of the doc file source. Needed by custom package configuration
# file section of dune-grid.
set(DUNE_MODULE_SRC_DOCDIR "${PROJECT_SOURCE_DIR}/doc")
set(MODULE_INSTALLED ON)
configure_package_config_file(${CONFIG_SOURCE_FILE}
${PROJECT_BINARY_DIR}/cmake/pkg/${ProjectName}-config.cmake
......@@ -889,6 +892,7 @@ macro(set_and_check _var _file)
message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
endif()
endmacro()")
set(MODULE_INSTALLED OFF)
configure_file(
${CONFIG_SOURCE_FILE}
${PROJECT_BINARY_DIR}/${ProjectName}-config.cmake @ONLY)
......
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