diff --git a/CMakeLists.txt b/CMakeLists.txt index e9a8d413..614d405c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,8 @@ list (APPEND opm-core_DEPS COMPONENTS date_time filesystem system unit_test_framework REQUIRED" # DUNE dependency "dune-istl" + # Ensembles-based Reservoir Tools (ERT) + "ERT" ) find_and_append_package_list (${opm-core_DEPS}) @@ -90,8 +92,11 @@ list (REMOVE_ITEM opmcore_SOURCES ${PROJECT_SOURCE_DIR}/opm/core/utility/parameters/tinyxml/xmltest.cpp ) -# we don't try to find any of these -set (HAVE_ERT) +# HAVE_ERT is used as an #ifdef, not as an #if in the source code, if it +# is not true, then it should be unset altogether +if (NOT HAVE_ERT) + set (HAVE_ERT) +endif (NOT HAVE_ERT) # create configuration header which describes available features # necessary to compile this library. singular version is the names that diff --git a/opm-core-config.cmake.in b/opm-core-config.cmake.in index ed73362d..0afbebb6 100644 --- a/opm-core-config.cmake.in +++ b/opm-core-config.cmake.in @@ -47,4 +47,16 @@ string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS) set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}") +# build with OpenMP if that was found +if (NOT "@OpenMP_C_FLAGS@" STREQUAL "") + string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS) + set (CMAKE_C_FLAG "@OpenMP_C_FLAGS@ ${CMAKE_C_FLAGS}") +endif (NOT "@OpenMP_C_FLAGS@" STREQUAL "") +if (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "") + string (REPLACE "@OpenMP_CXX_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS) + set (CMAKE_C_FLAG "@OpenMP_CXX_FLAGS@ ${CMAKE_CXX_FLAGS}") +endif (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "") + # this is the contents of config.h as far as our probes can tell: