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

[CMake] Fixes issues with DUNE_INSTALL_MODULEDIR for changes in INSTALL variables

Previously, if the user changed e.g. CMAKE_INSTALL_PREFIX or
CMAKE_INSTALL_DATAROOTDIR these changes where never mimiced in
DUNE_INSTALL_MODULEDIR. This patch fixes this problem, such that
DUNE_INSTALL_MODULEDIR changes unless it is explicitely set by the
user before.

We do using the same approach as in GNUInstallDirs.cmake. That is, we
whether DUNE_INSTALL_MODULEDIR is set to a non-empty string. If that
is the case we set an empty cache variable and overwrite locally with
the default value. The default value is now a relative path.
parent 50da42a9
No related branches found
No related tags found
No related merge requests found
......@@ -491,11 +491,12 @@ macro(dune_project)
# Thus the user can override it and for example install
# directly into the CMake installation. This has to be an
# absolute path. Default: ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules
if(NOT DEFINED DUNE_INSTALL_MODULEDIR)
set(DUNE_INSTALL_MODULEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules
if(NOT DUNE_INSTALL_MODULEDIR)
set(DUNE_INSTALL_MODULEDIR ""
CACHE PATH
"Installation directory for CMake modules. Be careful when overriding this as the modules might not be found any more. Might be set to ${CMAKE_ROOT}/Modules or better \${CMAKE_ROOT}/Modules to make the modules available to all CMake runs. This has to be an absolute path. Default: \${CMAKE_INSTALL_PREFIX}/\${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules")
endif(NOT DEFINED DUNE_INSTALL_MODULEDIR)
"Installation directory for CMake modules. Default is \${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules when not set explicitely")
set(DUNE_INSTALL_MODULEDIR ${CMAKE_INSTALL_DATAROOTDIR}/cmake/modules)
endif(NOT DUNE_INSTALL_MODULEDIR)
endmacro(dune_project)
# create a new config.h file and overwrite the existing one
......
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