From ea1afba73801f43f0bb848c0d53279694498cb89 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 14 Aug 2013 20:28:16 +0200 Subject: [PATCH] Put HAVE_DYNAMIC_BOOST_TEST in config.h for tests only This define is used by the unit tests; there is no reason why it should be on the list that must be provided by other projects that use our headers (the other projects don't use our tests). --- cmake/Modules/OpmLibMain.cmake | 7 ++++++- cmake/Modules/UseDynamicBoost.cmake | 3 +++ cmake/Modules/dune-cornerpoint-prereqs.cmake | 1 - cmake/Modules/opm-autodiff-prereqs.cmake | 1 - cmake/Modules/opm-core-prereqs.cmake | 1 - cmake/Modules/opm-polymer-prereqs.cmake | 1 - cmake/Modules/opm-porsol-prereqs.cmake | 1 - cmake/Modules/opm-upscaling-prereqs.cmake | 1 - 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cmake/Modules/OpmLibMain.cmake b/cmake/Modules/OpmLibMain.cmake index 4c71bea6..6043e227 100644 --- a/cmake/Modules/OpmLibMain.cmake +++ b/cmake/Modules/OpmLibMain.cmake @@ -145,11 +145,16 @@ 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. +# TESTING_CONFIG_VARS is what's required by the unit tests, and is therefore +# added in an ad-hoc manner to avoid putting dependencies to it in the module +# requirement file. (it should be added if there is .h code that needs it) 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} ${${project}_CONFIG_IMPL_VARS} + WRITE ${${project}_CONFIG_VARS} + ${${project}_CONFIG_IMPL_VARS} + ${TESTING_CONFIG_VARS} ) # call this hook to let it setup necessary conditions for Fortran support diff --git a/cmake/Modules/UseDynamicBoost.cmake b/cmake/Modules/UseDynamicBoost.cmake index c889ad9a..590d23a1 100644 --- a/cmake/Modules/UseDynamicBoost.cmake +++ b/cmake/Modules/UseDynamicBoost.cmake @@ -31,3 +31,6 @@ endif (${Boost_UNIT_TEST_FRAMEWORK_FOUND}) set (HAVE_DYNAMIC_BOOST_TEST "${HAVE_DYNAMIC_BOOST_TEST}" CACHE BOOL "Whether Boost::Test is dynamically linked or not" ) + +# include in config.h +list (APPEND TESTING_CONFIG_VARS "HAVE_DYNAMIC_BOOST_TEST") diff --git a/cmake/Modules/dune-cornerpoint-prereqs.cmake b/cmake/Modules/dune-cornerpoint-prereqs.cmake index ce1e001d..c7a0a358 100644 --- a/cmake/Modules/dune-cornerpoint-prereqs.cmake +++ b/cmake/Modules/dune-cornerpoint-prereqs.cmake @@ -3,7 +3,6 @@ # defines that must be present in config.h for our headers set (dune-cornerpoint_CONFIG_VAR - HAVE_DYNAMIC_BOOST_TEST DUNE_GRID_VERSION_MAJOR DUNE_GRID_VERSION_MINOR DUNE_GRID_VERSION_REVISION diff --git a/cmake/Modules/opm-autodiff-prereqs.cmake b/cmake/Modules/opm-autodiff-prereqs.cmake index ea501984..d2b44bf5 100644 --- a/cmake/Modules/opm-autodiff-prereqs.cmake +++ b/cmake/Modules/opm-autodiff-prereqs.cmake @@ -3,7 +3,6 @@ # defines that must be present in config.h for our headers set (opm-autodiff_CONFIG_VAR - HAVE_DYNAMIC_BOOST_TEST ) # dependencies diff --git a/cmake/Modules/opm-core-prereqs.cmake b/cmake/Modules/opm-core-prereqs.cmake index 5e26afcf..0af5372c 100644 --- a/cmake/Modules/opm-core-prereqs.cmake +++ b/cmake/Modules/opm-core-prereqs.cmake @@ -4,7 +4,6 @@ # defines that must be present in config.h for our headers set (opm-core_CONFIG_VAR HAVE_DUNE_ISTL - HAVE_DYNAMIC_BOOST_TEST HAVE_ERT HAVE_SUITESPARSE_UMFPACK_H HAVE_NULLPTR diff --git a/cmake/Modules/opm-polymer-prereqs.cmake b/cmake/Modules/opm-polymer-prereqs.cmake index 28f98369..91337270 100644 --- a/cmake/Modules/opm-polymer-prereqs.cmake +++ b/cmake/Modules/opm-polymer-prereqs.cmake @@ -3,7 +3,6 @@ # defines that must be present in config.h for our headers set (opm-polymer_CONFIG_VAR - HAVE_DYNAMIC_BOOST_TEST HAVE_ERT ) diff --git a/cmake/Modules/opm-porsol-prereqs.cmake b/cmake/Modules/opm-porsol-prereqs.cmake index d22c4438..f46890f1 100644 --- a/cmake/Modules/opm-porsol-prereqs.cmake +++ b/cmake/Modules/opm-porsol-prereqs.cmake @@ -3,7 +3,6 @@ # defines that must be present in config.h for our headers set (opm-porsol_CONFIG_VAR - HAVE_DYNAMIC_BOOST_TEST HAVE_VALGRIND ) diff --git a/cmake/Modules/opm-upscaling-prereqs.cmake b/cmake/Modules/opm-upscaling-prereqs.cmake index 11a4edf7..bd5656bb 100644 --- a/cmake/Modules/opm-upscaling-prereqs.cmake +++ b/cmake/Modules/opm-upscaling-prereqs.cmake @@ -3,7 +3,6 @@ # defines that must be present in config.h for our headers set (opm-upscaling_CONFIG_VAR - HAVE_DYNAMIC_BOOST_TEST HAVE_LAPACK HAVE_SUPERLU )