Move writing of config module to library routine
This commit is contained in:
parent
18a6f709b0
commit
5ed1aa37f0
@ -211,30 +211,6 @@ target_link_libraries (opmcore ${opm-core_LIBRARIES})
|
|||||||
# queue this executable to be stripped
|
# queue this executable to be stripped
|
||||||
strip_debug_symbols (opmcore opm-core_DEBUG)
|
strip_debug_symbols (opmcore opm-core_DEBUG)
|
||||||
|
|
||||||
# we need to know the name of the library which is generated
|
|
||||||
get_target_property (opm-core_LIBRARY opmcore LOCATION)
|
|
||||||
|
|
||||||
# write configuration file to locate library
|
|
||||||
configure_file (
|
|
||||||
${PROJECT_SOURCE_DIR}/opm-core-config.cmake.in
|
|
||||||
${PROJECT_BINARY_DIR}/opm-core-config.cmake
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
configure_file (
|
|
||||||
${PROJECT_SOURCE_DIR}/opm-core-config-version.cmake.in
|
|
||||||
${PROJECT_BINARY_DIR}/opm-core-config-version.cmake
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
configure_vars (
|
|
||||||
FILE CMAKE "${PROJECT_BINARY_DIR}/opm-core-config.cmake"
|
|
||||||
APPEND "${opm-core_CONFIG_VARS}"
|
|
||||||
)
|
|
||||||
configure_file (
|
|
||||||
${PROJECT_SOURCE_DIR}/dune.module.in
|
|
||||||
${PROJECT_BINARY_DIR}/dune.module
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
|
|
||||||
# pre-compile common headers; this is setup *after* the library to pick
|
# pre-compile common headers; this is setup *after* the library to pick
|
||||||
# up extra options set there
|
# up extra options set there
|
||||||
option (PRECOMPILE_HEADERS "Precompile common headers for speed." ON)
|
option (PRECOMPILE_HEADERS "Precompile common headers for speed." ON)
|
||||||
@ -284,6 +260,9 @@ install (
|
|||||||
)
|
)
|
||||||
message (STATUS "This build defaults to installing in ${CMAKE_INSTALL_PREFIX}")
|
message (STATUS "This build defaults to installing in ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
|
# we need to know the name of the library which is generated
|
||||||
|
get_target_property (opm-core_LIBRARY opmcore LOCATION)
|
||||||
|
|
||||||
# installation of CMake modules to help user programs locate the library
|
# installation of CMake modules to help user programs locate the library
|
||||||
include (OpmProject)
|
include (OpmProject)
|
||||||
opm_cmake_config (opm-core)
|
opm_cmake_config (opm-core)
|
||||||
|
@ -2,7 +2,28 @@
|
|||||||
|
|
||||||
# installation of CMake modules to help user programs locate the library
|
# installation of CMake modules to help user programs locate the library
|
||||||
function (opm_cmake_config name)
|
function (opm_cmake_config name)
|
||||||
# replace the build directory with the target directory in the
|
# write configuration file to locate library
|
||||||
|
configure_file (
|
||||||
|
${PROJECT_SOURCE_DIR}/${name}-config.cmake.in
|
||||||
|
${PROJECT_BINARY_DIR}/${name}-config.cmake
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file (
|
||||||
|
${PROJECT_SOURCE_DIR}/${name}-config-version.cmake.in
|
||||||
|
${PROJECT_BINARY_DIR}/${name}-config-version.cmake
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_vars (
|
||||||
|
FILE CMAKE "${PROJECT_BINARY_DIR}/${name}-config.cmake"
|
||||||
|
APPEND "${${name}_CONFIG_VARS}"
|
||||||
|
)
|
||||||
|
configure_file (
|
||||||
|
${PROJECT_SOURCE_DIR}/dune.module.in
|
||||||
|
${PROJECT_BINARY_DIR}/dune.module
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
# replace the build directory with the target directory in the
|
||||||
# variables that contains build paths
|
# variables that contains build paths
|
||||||
string (REPLACE
|
string (REPLACE
|
||||||
"${PROJECT_SOURCE_DIR}"
|
"${PROJECT_SOURCE_DIR}"
|
||||||
|
Loading…
Reference in New Issue
Block a user