From 1e9d368012fec6a59c11ee21f487571c59e4615d Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Sun, 4 Aug 2013 21:30:13 +0200 Subject: [PATCH] Create a set of config variables for implementation The config variables in _CONFIG_IMPL_VARS are only written to config.h and not the .pc or -config.cmake files. They can thus only be used by the implementation files and not the headers. Use this set to avoid exposing the variables to other projects, when it is likely that a probe used by that other project may turn up a different result. --- cmake/Modules/OpmFind.cmake | 1 + cmake/Modules/OpmLibMain.cmake | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/OpmFind.cmake b/cmake/Modules/OpmFind.cmake index 091f0500..77aa9969 100644 --- a/cmake/Modules/OpmFind.cmake +++ b/cmake/Modules/OpmFind.cmake @@ -42,6 +42,7 @@ set (_opm_proj_vars INCLUDE_DIRS LIBRARY_DIRS CONFIG_VARS + CONFIG_IMPL_VARS ) # ensure that they are at least the empty list after we're done diff --git a/cmake/Modules/OpmLibMain.cmake b/cmake/Modules/OpmLibMain.cmake index ad2e4d5d..ca68ccb2 100644 --- a/cmake/Modules/OpmLibMain.cmake +++ b/cmake/Modules/OpmLibMain.cmake @@ -129,11 +129,13 @@ include (ConfigVars) list (APPEND ${project}_CONFIG_VARS ${${project}_CONFIG_VAR}) # write configuration variables to this file. note that it is a temporary. +# _CONFIG_IMPL_VARS are defines that are only written to config.h internal +# to this project; they are not exported to any installed files. message (STATUS "Writing config file \"${PROJECT_BINARY_DIR}/config.h\"...") set (CONFIG_H "${PROJECT_BINARY_DIR}/config.h.tmp") configure_vars ( FILE CXX ${CONFIG_H} - WRITE ${${project}_CONFIG_VARS} + WRITE ${${project}_CONFIG_VARS} ${${project}_CONFIG_IMPL_VARS} ) # call this hook to let it setup necessary conditions for Fortran support