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.
This commit is contained in:
Roland Kaufmann 2013-08-04 21:30:13 +02:00
parent 3d366d9cdf
commit de5d5ec7dc
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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