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:
Roland Kaufmann 2014-01-24 12:48:58 +01:00 committed by Bård Skaflestad
parent d9228403d4
commit 8cbfaa3c14
3 changed files with 33 additions and 0 deletions

View 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 ()

View File

@ -89,6 +89,9 @@ endif (COMMAND prereqs_hook)
include (OpmFind) include (OpmFind)
find_and_append_package_list_to (${project} ${${project}_DEPS}) 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; # remove the dependency on the testing framework from the main library;
# it is not possible to query for Boost twice with different components. # it is not possible to query for Boost twice with different components.
list (REMOVE_ITEM "${project}_LIBRARIES" "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}") list (REMOVE_ITEM "${project}_LIBRARIES" "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")

View File

@ -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 system usable with dunecontrol. There is one in the project root directory
which just forwards everything to the main script in `cmake/Scripts`. 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> <tr>
<td> OpmCompile <td> OpmCompile
<td> <td>