From bc9c8a7068d22a0e84502893c3325cf0eb295b3e Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Tue, 25 Jun 2013 23:49:36 +0200 Subject: [PATCH] Get prerequisites from a separate "header" file Note that the variable containing the dependencies must be expanded inside quotes; otherwise the list will spill into the argument list! --- cmake/Modules/Finddune-cornerpoint.cmake | 10 +++++----- cmake/Modules/Findopm-core.cmake | 25 +++++------------------- cmake/Modules/Findopm-polymer.cmake | 9 +++++---- cmake/Modules/Findopm-porsol.cmake | 12 +++++------- cmake/Modules/Findopm-upscaling.cmake | 13 +++++------- 5 files changed, 25 insertions(+), 44 deletions(-) diff --git a/cmake/Modules/Finddune-cornerpoint.cmake b/cmake/Modules/Finddune-cornerpoint.cmake index 325fd5da..d74a02fb 100644 --- a/cmake/Modules/Finddune-cornerpoint.cmake +++ b/cmake/Modules/Finddune-cornerpoint.cmake @@ -10,16 +10,15 @@ # Copyright (C) 2013 Uni Research AS # This code is licensed under The GNU General Public License v3.0 +include (dune-cornerpoint-prereqs) include (OpmPackage) find_opm_package ( # module name "dune-cornerpoint" # dependencies - "dune-common REQUIRED; - dune-grid REQUIRED; - opm-core REQUIRED - " + "${dune-cornerpoint_DEPS}" + # header to search for "dune/grid/CpGrid.hpp" @@ -37,6 +36,7 @@ int main (void) { } " # config variables - "") + "${dune-cornerpoint_CONFIG_VAR}" + ) #debug_find_vars ("dune-cornerpoint") diff --git a/cmake/Modules/Findopm-core.cmake b/cmake/Modules/Findopm-core.cmake index 3703bbd7..dd96f682 100644 --- a/cmake/Modules/Findopm-core.cmake +++ b/cmake/Modules/Findopm-core.cmake @@ -11,24 +11,15 @@ # This code is licensed under The GNU General Public License v3.0 # use the generic find routine +include (opm-core-prereqs) include (OpmPackage) find_opm_package ( # module name "opm-core" # dependencies - "C99; - CXX11Features; - Boost 1.39.0 - COMPONENTS date_time filesystem system unit_test_framework signals REQUIRED; - BLAS REQUIRED; - LAPACK REQUIRED; - SuiteSparse COMPONENTS umfpack; - SuperLU; - TinyXML; - ERT; - dune-istl - " + "${opm-core_DEPS}" + # header to search for "opm/core/grid.h" @@ -48,13 +39,7 @@ int main (void) { } " # config variables - "HAVE_AGMG; - HAVE_DUNE_ISTL; - HAVE_DYNAMIC_BOOST_TEST; - HAVE_ERT; - HAVE_SUITESPARSE_UMFPACK_H; - HAVE_NULLPTR; - HAVE_STATIC_ASSERT - ") + "${opm-core_CONFIG_VAR}" + ) include (UseDynamicBoost) #debug_find_vars ("opm-core") diff --git a/cmake/Modules/Findopm-polymer.cmake b/cmake/Modules/Findopm-polymer.cmake index 647a4eec..b865c863 100644 --- a/cmake/Modules/Findopm-polymer.cmake +++ b/cmake/Modules/Findopm-polymer.cmake @@ -10,15 +10,15 @@ # Copyright (C) 2013 Uni Research AS # This code is licensed under The GNU General Public License v3.0 +include (opm-polymer-prereqs) include (OpmPackage) find_opm_package ( # module name "opm-polymer" # dependencies - "ERT; - opm-core REQUIRED - " + "${opm-polymer_DEPS}" + # header to search for "opm/polymer/PolymerState.hpp" @@ -36,6 +36,7 @@ int main (void) { } " # config variables - "HAVE_ERT") + "${opm-polymer_CONFIG_VAR}" + ) #debug_find_vars ("opm-polymer") diff --git a/cmake/Modules/Findopm-porsol.cmake b/cmake/Modules/Findopm-porsol.cmake index 611d3fe4..48ea9888 100644 --- a/cmake/Modules/Findopm-porsol.cmake +++ b/cmake/Modules/Findopm-porsol.cmake @@ -10,18 +10,15 @@ # Copyright (C) 2013 Uni Research AS # This code is licensed under The GNU General Public License v3.0 +include (opm-porsol-prereqs) include (OpmPackage) find_opm_package ( # module name "opm-porsol" # dependencies - "dune-common REQUIRED; - dune-grid REQUIRED; - dune-istl REQUIRED; - opm-core REQUIRED; - dune-cornerpoint REQUIRED - " + "${opm-porsol_DEPS}" + # header to search for "opm/porsol/mimetic/IncompFlowSolverHybrid.hpp" @@ -38,6 +35,7 @@ int main (void) { } " # config variables - "HAVE_VALGRIND") + "${opm-porsol_CONFIG_VAR}" + ) #debug_find_vars ("opm-porsol") diff --git a/cmake/Modules/Findopm-upscaling.cmake b/cmake/Modules/Findopm-upscaling.cmake index 5042b1e0..c802d8fc 100644 --- a/cmake/Modules/Findopm-upscaling.cmake +++ b/cmake/Modules/Findopm-upscaling.cmake @@ -10,19 +10,15 @@ # Copyright (C) 2013 Uni Research AS # This code is licensed under The GNU General Public License v3.0 +include (opm-upscaling-prereqs) include (OpmPackage) find_opm_package ( # module name "opm-upscaling" # dependencies - "dune-common REQUIRED; - dune-grid REQUIRED; - dune-istl REQUIRED; - opm-core REQUIRED; - dune-cornerpoint REQUIRED; - opm-porsol REQUIRED - " + "${opm-upscaling_DEPS}" + # header to search for "opm/upscaling/SinglePhaseUpscaler.hpp" @@ -39,6 +35,7 @@ int main (void) { } " # config variables - "HAVE_SUPERLU") + "${opm-upscaling_CONFIG_VAR}" + ) #debug_find_vars ("opm-upscaling")