From eea5ac6d1de9de49f7c2f30cbabebd154c47d7a3 Mon Sep 17 00:00:00 2001 From: Fredrik Gundersen Date: Wed, 7 Jan 2015 09:16:35 +0100 Subject: [PATCH] Enable usage of external ERT source This change in cmakelist enables the usage of an external ERT source. You can now point to a later version of ERT and use this in sted of the one bundled in the ResInsight source. --- CMakeLists.txt | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ed8203cdd..836e258ab3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,22 +57,46 @@ SET(INSTALL_ERT OFF CACHE BOOL "ERT: Install library") SET(BUILD_SHARED_LIBS OFF CACHE BOOL "ERT: Build shared libraries") SET(ERT_USE_OPENMP ${OPENMP_FOUND} CACHE BOOL "ERT: Compile using OpenMP") - -add_subdirectory(ThirdParty/Ert/devel) - -include_directories( +option( ERT_EXTERNAL "Build ERT from external source" OFF) +SET(EXT_ERT_ROOT "" CACHE STRING "Path to ERT CMakeList.txt (source path)") + +if (ERT_EXTERNAL) + if (EXT_ERT_ROOT) + set(ERT_SOURCE_PATH "${EXT_ERT_ROOT}") + + add_subdirectory(${ERT_SOURCE_PATH} ${CMAKE_BINARY_DIR}/ThirdParty/Ert) + include_directories( + ${ERT_SOURCE_PATH}/libecl/include/ert/ecl + ${ERT_SOURCE_PATH}/libert_util/include/ert/util + ${ERT_SOURCE_PATH}/libgeometry/include/ert/geometry + ${ERT_SOURCE_PATH}/libecl_well/include/ert/ecl_well + ${ERT_SOURCE_PATH}/libecl/include + ${ERT_SOURCE_PATH}/libert_util/include + ${ERT_SOURCE_PATH}/libgeometry/include + ${ERT_SOURCE_PATH}/libecl_well/include + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/libert_util/include/ert/util + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/libert_util/include + ) + endif(EXT_ERT_ROOT) + +else (ERT_EXTERNAL) + add_subdirectory(ThirdParty/Ert/devel) + include_directories( ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include/ert/ecl ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include/ert/geometry ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include + ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include -) + ) +endif (ERT_EXTERNAL) ################################################################################