fixed: we need different paths in installed and in-tree config file

fixes #44
This commit is contained in:
Arne Morten Kvarving 2015-09-21 14:21:21 +02:00
parent 8cd76e6d9e
commit 0b321d31ef
2 changed files with 8 additions and 3 deletions

View File

@ -8,9 +8,12 @@ set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
macro (dir_hook)
endmacro (dir_hook)
# We need to define this variable in the cmake config file.
set(OPM_PROJECT_EXTRA_CODE "set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
# We need to define this variable in the installed cmake config file.
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
set(OPM_PROJECT_EXTRA_CODE_INTREE "set(OPM_MACROS_ROOT ${OPM_COMMON_ROOT})
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
# project information is in dune.module. Read this file and set variables.
# we cannot generate dune.module since it is read by dunecontrol before

View File

@ -73,6 +73,7 @@ function (opm_cmake_config name)
set (template_dir "${OPM_MACROS_ROOT}/cmake/Templates")
# write configuration file to locate library
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INTREE})
configure_cmake_file (${name} "config" "")
configure_cmake_file (${name} "config" "-version")
configure_vars (
@ -109,6 +110,7 @@ function (opm_cmake_config name)
)
# create a config mode file which targets the install directory instead
# of the build directory (using the same input template)
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INSTALLED})
configure_cmake_file (${name} "install" "")
configure_vars (
FILE CMAKE "${PROJECT_BINARY_DIR}/${${name}_NAME}-install.cmake"