mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Create aliases for probed variables
Headers from other libraries (notably DUNE) require definitions of other variables than our probe process set (e.g. HAVE_UMFPACK instead of HAVE_SUITESPARSE_UMFPACK_H). This module sets those aliases for compatibility.
This commit is contained in:
parent
d9228403d4
commit
8cbfaa3c14
24
cmake/Modules/OpmAliases.cmake
Normal file
24
cmake/Modules/OpmAliases.cmake
Normal file
@ -0,0 +1,24 @@
|
||||
# - Alias probed variables for compatibility with DUNE buildsystem
|
||||
#
|
||||
# DUNE build system sets some variables which have different names
|
||||
# in the CMake modules we are using; this module set those variable
|
||||
# so they can be exported to config.h visible to DUNE headers
|
||||
|
||||
function (set_aliases)
|
||||
# hardcoded list of "dune-var opm-var" pairs, where the components
|
||||
# are separated by space
|
||||
set (aliases
|
||||
)
|
||||
foreach (alias IN LISTS aliases)
|
||||
# convert entry "X Y" into a list "X;Y", then pick apart
|
||||
string (REGEX REPLACE "\ +" ";" tuple "${alias}")
|
||||
list (GET tuple 0 var)
|
||||
list (GET tuple 1 name)
|
||||
|
||||
# write this alias to cache
|
||||
set (${var} ${${name}} PARENT_SCOPE)
|
||||
endforeach (alias)
|
||||
endfunction (set_aliases)
|
||||
|
||||
# always call this when the module is imported
|
||||
set_aliases ()
|
@ -89,6 +89,9 @@ endif (COMMAND prereqs_hook)
|
||||
include (OpmFind)
|
||||
find_and_append_package_list_to (${project} ${${project}_DEPS})
|
||||
|
||||
# set aliases to probed variables
|
||||
include (OpmAliases)
|
||||
|
||||
# remove the dependency on the testing framework from the main library;
|
||||
# it is not possible to query for Boost twice with different components.
|
||||
list (REMOVE_ITEM "${project}_LIBRARIES" "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||
|
@ -423,6 +423,12 @@ Wrapper script which emulates an autotools front-end, making the build
|
||||
system usable with dunecontrol. There is one in the project root directory
|
||||
which just forwards everything to the main script in `cmake/Scripts`.
|
||||
|
||||
<tr>
|
||||
<td> OpmAliases
|
||||
<td>
|
||||
Copy variables which are probed by our find modules to the names which
|
||||
are expected by DUNE.
|
||||
|
||||
<tr>
|
||||
<td> OpmCompile
|
||||
<td>
|
||||
|
Loading…
Reference in New Issue
Block a user