Merge pull request #199 from rolk/199_uppercase
Allow modules to use all-uppercase variables
This commit is contained in:
commit
d11d84c418
@ -36,7 +36,7 @@ set (${project}_DEPS
|
|||||||
# Tim Davis' SuiteSparse archive
|
# Tim Davis' SuiteSparse archive
|
||||||
"SuiteSparse COMPONENTS umfpack"
|
"SuiteSparse COMPONENTS umfpack"
|
||||||
# solver
|
# solver
|
||||||
"SUPERLU"
|
"SuperLU"
|
||||||
# xml processing (for config parsing)
|
# xml processing (for config parsing)
|
||||||
"TinyXML"
|
"TinyXML"
|
||||||
# Ensembles-based Reservoir Tools (ERT)
|
# Ensembles-based Reservoir Tools (ERT)
|
||||||
|
@ -24,7 +24,7 @@ find_opm_package (
|
|||||||
|
|
||||||
# required dependencies
|
# required dependencies
|
||||||
"dune-common ${_require_dune_common};
|
"dune-common ${_require_dune_common};
|
||||||
SUPERLU
|
SuperLU
|
||||||
"
|
"
|
||||||
# header to search for
|
# header to search for
|
||||||
"dune/istl/bcrsmatrix.hh"
|
"dune/istl/bcrsmatrix.hh"
|
||||||
|
@ -24,7 +24,7 @@ find_opm_package (
|
|||||||
BLAS REQUIRED;
|
BLAS REQUIRED;
|
||||||
LAPACK REQUIRED;
|
LAPACK REQUIRED;
|
||||||
SuiteSparse COMPONENTS umfpack;
|
SuiteSparse COMPONENTS umfpack;
|
||||||
SUPERLU;
|
SuperLU;
|
||||||
TinyXML;
|
TinyXML;
|
||||||
ERT;
|
ERT;
|
||||||
dune-istl
|
dune-istl
|
||||||
|
@ -81,23 +81,34 @@ macro (find_and_append_package_to prefix name)
|
|||||||
message (STATUS "Finding package ${name} using module mode")
|
message (STATUS "Finding package ${name} using module mode")
|
||||||
find_package (${name} ${ARGN})
|
find_package (${name} ${ARGN})
|
||||||
endif (${name}_DIR)
|
endif (${name}_DIR)
|
||||||
if (${name}_FOUND)
|
if (${name}_FOUND OR ${NAME}_FOUND)
|
||||||
foreach (var IN LISTS _opm_proj_vars)
|
foreach (var IN LISTS _opm_proj_vars)
|
||||||
if (DEFINED ${name}_${var})
|
if (DEFINED ${name}_${var})
|
||||||
list (APPEND ${prefix}_${var} ${${name}_${var}})
|
list (APPEND ${prefix}_${var} ${${name}_${var}})
|
||||||
# cleanup lists
|
# some packages define an uppercase version of their own name
|
||||||
if ("${var}" STREQUAL "LIBRARIES")
|
elseif (DEFINED ${NAME}_${var})
|
||||||
remove_duplicate_libraries (${prefix})
|
list (APPEND ${prefix}_${var} ${${NAME}_${var}})
|
||||||
else ("${var}" STREQUAL "LIBRARIES")
|
|
||||||
list (REMOVE_DUPLICATES ${prefix}_${var})
|
|
||||||
endif ("${var}" STREQUAL "LIBRARIES")
|
|
||||||
endif (DEFINED ${name}_${var})
|
endif (DEFINED ${name}_${var})
|
||||||
|
# some packages define _PATH instead of _DIRS (Hi, MPI!)
|
||||||
|
if ("${var}" STREQUAL "INCLUDE_DIRS")
|
||||||
|
if (DEFINED ${name}_INCLUDE_PATH)
|
||||||
|
list (APPEND ${prefix}_INCLUDE_DIRS ${name}_INCLUDE_PATH)
|
||||||
|
elseif (DEFINED ${NAME}_INCLUDE_PATH)
|
||||||
|
list (APPEND ${prefix}_INCLUDE_DIRS ${NAME}_INCLUDE_PATH)
|
||||||
|
endif (DEFINED ${name}_INCLUDE_PATH)
|
||||||
|
endif ("${var}" STREQUAL "INCLUDE_DIRS")
|
||||||
|
# cleanup lists
|
||||||
|
if ("${var}" STREQUAL "LIBRARIES")
|
||||||
|
remove_duplicate_libraries (${prefix})
|
||||||
|
else ("${var}" STREQUAL "LIBRARIES")
|
||||||
|
list (REMOVE_DUPLICATES ${prefix}_${var})
|
||||||
|
endif ("${var}" STREQUAL "LIBRARIES")
|
||||||
endforeach (var)
|
endforeach (var)
|
||||||
# some libraries only define xxx_FOUND and not a corresponding HAVE_xxx
|
# some libraries only define xxx_FOUND and not a corresponding HAVE_xxx
|
||||||
if (NOT DEFINED HAVE_${NAME})
|
if (NOT DEFINED HAVE_${NAME})
|
||||||
set (HAVE_${NAME} 1)
|
set (HAVE_${NAME} 1)
|
||||||
endif (NOT DEFINED HAVE_${NAME})
|
endif (NOT DEFINED HAVE_${NAME})
|
||||||
endif (${name}_FOUND)
|
endif (${name}_FOUND OR ${NAME}_FOUND)
|
||||||
endmacro (find_and_append_package_to prefix name)
|
endmacro (find_and_append_package_to prefix name)
|
||||||
|
|
||||||
# append to the list of variables associated with the project
|
# append to the list of variables associated with the project
|
||||||
|
@ -219,6 +219,11 @@ function (find_opm_package module deps header lib defs prog conf)
|
|||||||
set (${module}_LINKER_FLAGS "${${module}_LINKER_FLAGS}" PARENT_SCOPE)
|
set (${module}_LINKER_FLAGS "${${module}_LINKER_FLAGS}" PARENT_SCOPE)
|
||||||
set (${module}_QUIET "${${module}_QUIET}" PARENT_SCOPE)
|
set (${module}_QUIET "${${module}_QUIET}" PARENT_SCOPE)
|
||||||
set (HAVE_${MODULE} "${HAVE_${MODULE}}" PARENT_SCOPE)
|
set (HAVE_${MODULE} "${HAVE_${MODULE}}" PARENT_SCOPE)
|
||||||
|
|
||||||
|
# print everything out if we're asked to
|
||||||
|
if (${module}_DEBUG)
|
||||||
|
debug_find_vars (${module})
|
||||||
|
endif (${module}_DEBUG)
|
||||||
endfunction (find_opm_package module deps header lib defs prog conf)
|
endfunction (find_opm_package module deps header lib defs prog conf)
|
||||||
|
|
||||||
# print all variables defined by the above macro
|
# print all variables defined by the above macro
|
||||||
|
Loading…
Reference in New Issue
Block a user