2022-08-02 00:52:34 -05:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
include(CheckCSourceCompiles)
|
2023-04-24 10:10:51 -05:00
|
|
|
include(FetchContent)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
project(ResInsight)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2024-09-30 04:21:17 -05:00
|
|
|
# Ensure all binary files ensd up in the same folder as the executable
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
set(VIZ_MODULES_FOLDER_NAME Fwk/VizFwk)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2024-10-07 03:16:48 -05:00
|
|
|
message(STATUS "Set CEE_USE_QT6 to ON")
|
2024-09-30 04:21:17 -05:00
|
|
|
set(CEE_USE_QT5 OFF)
|
|
|
|
set(CEE_USE_QT6 ON)
|
|
|
|
|
2018-11-27 02:47:44 -06:00
|
|
|
cmake_policy(SET CMP0020 NEW)
|
2021-04-29 03:42:16 -05:00
|
|
|
if(POLICY CMP0077)
|
2023-01-24 05:29:27 -06:00
|
|
|
cmake_policy(SET CMP0077 NEW)
|
2020-11-04 03:44:07 -06:00
|
|
|
endif()
|
2023-04-24 10:10:51 -05:00
|
|
|
if(POLICY CMP0135)
|
|
|
|
cmake_policy(SET CMP0135 OLD)
|
|
|
|
endif()
|
2020-10-27 05:41:48 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(UNIX)
|
|
|
|
option(
|
|
|
|
RESINSIGHT_PREFER_LEGACY_OPENGL
|
|
|
|
"Link with Legacy OpenGL libraries. This may be necessary in some virtualization environments"
|
2021-09-01 01:13:16 -05:00
|
|
|
ON
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
if(RESINSIGHT_PREFER_LEGACY_OPENGL)
|
|
|
|
set(OpenGL_GL_PREFERENCE LEGACY)
|
|
|
|
endif()
|
2020-10-27 05:41:48 -05:00
|
|
|
endif()
|
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
set(BUILD_SHARED_LIBS
|
|
|
|
OFF
|
2021-09-01 01:13:16 -05:00
|
|
|
CACHE BOOL "ERT: Build shared libraries"
|
|
|
|
)
|
2013-04-12 08:27:18 -05:00
|
|
|
|
2019-01-04 06:58:39 -06:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
|
|
|
|
2021-01-15 06:38:25 -06:00
|
|
|
option(RESINSIGHT_BUNDLE_TESTMODELS "Copy TestModels into the installation" OFF)
|
2023-05-21 08:15:09 -05:00
|
|
|
mark_as_advanced(RESINSIGHT_BUNDLE_TESTMODELS)
|
2021-01-14 04:10:55 -06:00
|
|
|
|
2023-01-19 01:20:07 -06:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2023-11-24 04:42:31 -06:00
|
|
|
|
2020-09-25 03:48:12 -05:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
2020-09-23 06:17:12 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2012-05-18 02:45:23 -05:00
|
|
|
# Setup the main platform defines
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
add_definitions(-DCVF_LINUX)
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
add_definitions(-DCVF_OSX)
|
2016-06-03 09:25:48 -05:00
|
|
|
elseif(MSVC)
|
2021-04-29 03:42:16 -05:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
|
|
|
set(_HAS_STD_BYTE 0)
|
2012-05-18 02:45:23 -05:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2024-09-16 01:53:19 -05:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
set(CMAKE_CXX_FLAGS
|
|
|
|
"-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat -Wno-unused-parameter"
|
|
|
|
)
|
|
|
|
|
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS
|
|
|
|
"-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat -Wno-unused-parameter -Wno-array-bounds -Wno-dangling-reference -Wno-stringop-overflow"
|
|
|
|
)
|
|
|
|
endif()
|
2021-04-29 03:42:16 -05:00
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG")
|
|
|
|
endif()
|
2013-08-30 08:37:29 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2013-10-07 00:23:04 -05:00
|
|
|
# OpenMP
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
|
|
|
option(RESINSIGHT_USE_OPENMP "Enable OpenMP parallellization in the code" ON)
|
|
|
|
if(RESINSIGHT_USE_OPENMP)
|
|
|
|
find_package(OpenMP)
|
|
|
|
if(OPENMP_FOUND)
|
|
|
|
message(STATUS "Enabling OpenMP support")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -DUSE_OPENMP")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS
|
2021-09-01 01:13:16 -05:00
|
|
|
"${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}"
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
else()
|
|
|
|
message(STATUS "Disabling OpenMP support")
|
|
|
|
endif()
|
2013-10-07 00:23:04 -05:00
|
|
|
endif()
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2023-01-27 11:31:35 -06:00
|
|
|
# ##############################################################################
|
|
|
|
# buildcache
|
|
|
|
# ##############################################################################
|
|
|
|
find_program(buildcache_program buildcache)
|
|
|
|
if(buildcache_program)
|
|
|
|
set(CMAKE_CXX_COMPILER_LAUNCHER "${buildcache_program}")
|
|
|
|
message(STATUS "Found buildcache from : ${buildcache_program}")
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
# New concept for defining MSVC debug info flags introduced in 3.25.
|
|
|
|
# Evaluate this concept to simplify the setting of CXX-flags
|
|
|
|
# https://cmake.org/cmake/help/v3.25/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.html#prop_tgt:MSVC_DEBUG_INFORMATION_FORMAT
|
|
|
|
# https://cmake.org/cmake/help/v3.25/policy/CMP0141.html#policy:CMP0141
|
|
|
|
|
|
|
|
# It is required to use compiler flag /Z7 to be able to use buildcache
|
|
|
|
# https://github.com/mbitsnbites/buildcache/blob/master/doc/usage.md
|
|
|
|
# https://learn.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-170
|
|
|
|
|
|
|
|
string(REGEX REPLACE "/Zi" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
|
|
string(REGEX REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG
|
|
|
|
"${CMAKE_CXX_FLAGS_DEBUG}"
|
|
|
|
)
|
|
|
|
string(REGEX REPLACE "/Zi" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
|
|
|
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Z7")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "No buildcache found")
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2021-01-12 02:48:02 -06:00
|
|
|
# ABAQUS ODB
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2021-01-12 02:48:02 -06:00
|
|
|
set(RESINSIGHT_ODB_API_DIR
|
|
|
|
""
|
|
|
|
CACHE
|
|
|
|
PATH
|
|
|
|
"Optional path to the ABAQUS ODB API from Simulia. Needed for support of geomechanical models"
|
|
|
|
)
|
2023-04-30 06:48:24 -05:00
|
|
|
|
2024-07-03 05:44:16 -05:00
|
|
|
option(RESINSIGHT_DOWNLOAD_ODB_FROM_SERVER
|
|
|
|
"Download ODB library from private repository" OFF
|
|
|
|
)
|
|
|
|
mark_as_advanced(FORCE RESINSIGHT_DOWNLOAD_ODB_FROM_SERVER)
|
|
|
|
set(RESINSIGHT_ODB_VERSION
|
|
|
|
"2020"
|
|
|
|
CACHE STRING "Abaqus API version to use, 2020 or 2024"
|
|
|
|
)
|
|
|
|
mark_as_advanced(FORCE RESINSIGHT_ODB_VERSION)
|
|
|
|
|
|
|
|
if(RESINSIGHT_DOWNLOAD_ODB_FROM_SERVER)
|
2023-04-30 06:48:24 -05:00
|
|
|
|
2024-07-03 05:44:16 -05:00
|
|
|
if(MSVC)
|
2023-04-30 06:48:24 -05:00
|
|
|
FetchContent_Declare(
|
2023-04-30 06:49:31 -05:00
|
|
|
odb-library-from-server
|
2024-07-03 05:44:16 -05:00
|
|
|
URL http://10.10.0.26:8080/job/resinsight-dependencies/ws/${RESINSIGHT_ODB_VERSION}/odb_api_win64.zip
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
FetchContent_Declare(
|
|
|
|
odb-library-from-server
|
|
|
|
URL http://10.10.0.26:8080/job/resinsight-dependencies/ws/${RESINSIGHT_ODB_VERSION}/odb_api_linux.zip
|
2023-04-30 06:48:24 -05:00
|
|
|
)
|
|
|
|
endif()
|
2024-07-03 05:44:16 -05:00
|
|
|
|
|
|
|
FetchContent_Populate(odb-library-from-server)
|
|
|
|
set(RESINSIGHT_ODB_API_DIR ${odb-library-from-server_SOURCE_DIR})
|
2023-04-30 06:48:24 -05:00
|
|
|
endif()
|
|
|
|
|
2021-01-12 02:48:02 -06:00
|
|
|
if(NOT ${RESINSIGHT_ODB_API_DIR} EQUAL "")
|
|
|
|
add_definitions(-DUSE_ODB_API)
|
|
|
|
set(RESINSIGHT_USE_ODB_API 1)
|
2024-07-03 05:44:16 -05:00
|
|
|
message(
|
|
|
|
STATUS
|
|
|
|
"Using ODB-Api ${RESINSIGHT_ODB_VERSION} from : ${RESINSIGHT_ODB_API_DIR}"
|
|
|
|
)
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(-D_WINDOWS_SOURCE)
|
|
|
|
else()
|
|
|
|
add_definitions(-D_LINUX_SOURCE)
|
|
|
|
endif()
|
2021-01-12 02:48:02 -06:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2013-01-22 02:30:28 -06:00
|
|
|
# Version number
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2024-08-27 00:38:53 -05:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
if(EXISTS "/etc/os-release")
|
|
|
|
# Read the contents of /etc/os-release
|
|
|
|
file(READ "/etc/os-release" OS_RELEASE_CONTENT)
|
|
|
|
|
|
|
|
# Extract ID
|
|
|
|
string(REGEX MATCH "PRETTY_NAME=\"?([^\n\"]+)\"?" _ ${OS_RELEASE_CONTENT})
|
|
|
|
set(RESINSIGHT_BUILD_SYSTEM_ID ${CMAKE_MATCH_1})
|
|
|
|
|
|
|
|
# Display the extracted values
|
|
|
|
message(STATUS "Operating System ID: ${RESINSIGHT_BUILD_SYSTEM_ID}")
|
|
|
|
else()
|
|
|
|
message(WARNING "/etc/os-release not found. Cannot determine OS details.")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
include(ResInsightVersion.cmake)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2019-01-04 06:58:39 -06:00
|
|
|
# Octave
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2019-01-04 06:58:39 -06:00
|
|
|
find_package(Octave)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2021-01-06 08:03:38 -06:00
|
|
|
# Grpc
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2021-01-06 08:03:38 -06:00
|
|
|
option(RESINSIGHT_ENABLE_GRPC "Enable the gRPC scripting framework" OFF)
|
|
|
|
if(RESINSIGHT_ENABLE_GRPC)
|
|
|
|
option(
|
|
|
|
RESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE
|
|
|
|
"Download the gRPC python modules to enable generation of Python interface"
|
2021-09-01 01:13:16 -05:00
|
|
|
ON
|
|
|
|
)
|
2021-01-06 08:03:38 -06:00
|
|
|
option(RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE
|
2021-09-01 01:13:16 -05:00
|
|
|
"Bundle the gRPC python modules into the install folder" OFF
|
|
|
|
)
|
2021-01-06 08:03:38 -06:00
|
|
|
add_definitions(-DENABLE_GRPC)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2020-08-28 08:06:50 -05:00
|
|
|
# Unity Build
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2016-06-10 07:03:22 -05:00
|
|
|
|
2020-01-23 06:41:31 -06:00
|
|
|
# CMAKE_UNITY_BUILD was introduced in CMake 3.16.2
|
2021-04-29 03:42:16 -05:00
|
|
|
option(RESINSIGHT_ENABLE_UNITY_BUILD
|
2021-09-01 01:13:16 -05:00
|
|
|
"Experimental speedup of compilation using CMake Unity Build" OFF
|
|
|
|
)
|
2020-01-23 06:41:31 -06:00
|
|
|
mark_as_advanced(FORCE RESINSIGHT_ENABLE_UNITY_BUILD)
|
|
|
|
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
|
|
|
set(CAF_ENABLE_UNITY_BUILD true)
|
|
|
|
set(CVF_ENABLE_UNITY_BUILD true)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2024-04-22 12:56:10 -05:00
|
|
|
# resdata
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2013-04-04 04:27:38 -05:00
|
|
|
|
2024-04-22 12:56:10 -05:00
|
|
|
# Use of CMAKE_CXX_COMPILER_LAUNCHER is not working with resdata. Disable by
|
2021-04-29 03:42:16 -05:00
|
|
|
# temporarily setting compiler launcher to nothing
|
2020-05-07 00:58:18 -05:00
|
|
|
set(TEMP_CMAKE_CXX_COMPILER_LAUNCHER ${CMAKE_CXX_COMPILER_LAUNCHER})
|
|
|
|
set(CMAKE_CXX_COMPILER_LAUNCHER)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(NOT MSVC)
|
|
|
|
# Linux: Optional configuration of externally installed ERT, requires path to
|
|
|
|
# libraries and includes
|
|
|
|
set(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT
|
|
|
|
""
|
2021-09-01 01:13:16 -05:00
|
|
|
CACHE PATH "Path to installed ERT libraries"
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
set(RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT
|
|
|
|
""
|
2021-09-01 01:13:16 -05:00
|
|
|
CACHE PATH "Path to installed ERT includes"
|
|
|
|
)
|
2016-05-26 14:23:16 -05:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
|
|
|
if(NOT (RESINSIGHT_ERT_EXTERNAL_LIB_ROOT
|
2021-09-01 01:13:16 -05:00
|
|
|
AND RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
message(
|
|
|
|
FATAL_ERROR
|
|
|
|
"Both RESINSIGHT_ERT_EXTERNAL_LIB_ROOT and RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT must be defined"
|
|
|
|
)
|
2016-05-26 14:23:16 -05:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
message(
|
|
|
|
FATAL_ERROR
|
2021-09-01 01:13:16 -05:00
|
|
|
"TODO: Building using and external system installed ERT is broken."
|
|
|
|
)
|
2017-08-09 01:31:18 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(APPEND ERT_INCLUDE_DIRS ${RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT})
|
|
|
|
|
2024-04-22 12:56:10 -05:00
|
|
|
list(APPEND ERT_LIBRARIES ${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}/resdata.so)
|
2016-05-26 14:23:16 -05:00
|
|
|
|
2016-06-02 05:50:42 -05:00
|
|
|
else()
|
2016-05-26 14:23:16 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# Disable install of ERT libs and headers, as Ert code is compiled and linked
|
|
|
|
# directly
|
|
|
|
set(INSTALL_ERT
|
|
|
|
OFF
|
2021-09-01 01:13:16 -05:00
|
|
|
CACHE BOOL "ERT: Install library"
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
set(ERT_USE_OPENMP
|
|
|
|
${OPENMP_FOUND}
|
2021-09-01 01:13:16 -05:00
|
|
|
CACHE BOOL "ERT: Compile using OpenMP"
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
|
|
|
|
# Remember original state
|
|
|
|
set(ORIGINAL_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
# Force static linking on Windows
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
set(ERT_HAVE_UNISTD OFF) # If anyone has mingw installed
|
|
|
|
else()
|
|
|
|
set(RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT
|
|
|
|
""
|
2021-09-01 01:13:16 -05:00
|
|
|
CACHE STRING "Path to ERT CMakeList.txt (source path)"
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
|
|
|
|
# Force dynamic linking on other platforms Copy of libraries into install
|
|
|
|
# folder of ResInsight is done a bit further down in this file
|
|
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
endif()
|
2016-05-26 14:23:16 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT)
|
2021-09-01 01:13:16 -05:00
|
|
|
add_subdirectory(
|
|
|
|
${RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT} ${CMAKE_BINARY_DIR}/ThirdParty/Ert
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
else()
|
|
|
|
add_subdirectory(ThirdParty/Ert)
|
|
|
|
endif()
|
2016-05-26 14:23:16 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(MSVC)
|
2024-04-22 12:56:10 -05:00
|
|
|
# resdata : Disable some warnings
|
2021-04-29 03:42:16 -05:00
|
|
|
set_target_properties(
|
2024-04-22 12:56:10 -05:00
|
|
|
resdata
|
2021-04-29 03:42:16 -05:00
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS
|
|
|
|
"/wd4244 /wd4267 /wd4013 /wd4190 /wd4018 /wd4477 /wd4098 /wd4293 /wd4305 /wd4020 /wd4028 /wd4715 /wd4245 /wd4804 /wd4100 /wd4456 /wd4458 /wd4090 /wd4297 /wd4701 /wd4101 /wd4702 /wd4457"
|
2016-05-26 14:23:16 -05:00
|
|
|
)
|
2022-01-26 03:08:28 -06:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
set_target_properties(
|
2024-04-22 12:56:10 -05:00
|
|
|
resdata
|
2022-01-26 03:08:28 -06:00
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS
|
|
|
|
"-Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare"
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
else()
|
|
|
|
set_target_properties(
|
2024-04-22 12:56:10 -05:00
|
|
|
resdata
|
2022-01-26 03:08:28 -06:00
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS
|
|
|
|
"-Wno-deprecated -Wno-deprecated-declarations -Wno-clobbered -Wno-int-in-bool-context"
|
2021-09-01 01:13:16 -05:00
|
|
|
)
|
2022-01-26 03:08:28 -06:00
|
|
|
|
|
|
|
target_compile_options(
|
2024-04-22 12:56:10 -05:00
|
|
|
resdata PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess>
|
2022-01-26 03:08:28 -06:00
|
|
|
)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
endif()
|
|
|
|
|
2024-04-22 12:56:10 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES resdata)
|
2021-04-29 03:42:16 -05:00
|
|
|
|
|
|
|
set_property(TARGET catch2 PROPERTY FOLDER "Thirdparty")
|
|
|
|
|
|
|
|
# Restore original state
|
|
|
|
set(BUILD_SHARED_LIBS ${ORIGINAL_BUILD_SHARED_LIBS})
|
2016-05-26 14:23:16 -05:00
|
|
|
|
|
|
|
endif(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
|
|
|
|
2024-04-22 12:56:10 -05:00
|
|
|
# restore buildcache when resdata has been configured
|
2020-05-07 00:58:18 -05:00
|
|
|
set(CMAKE_CXX_COMPILER_LAUNCHER ${TEMP_CMAKE_CXX_COMPILER_LAUNCHER})
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2020-04-17 02:31:42 -05:00
|
|
|
# Init GIT submodules if they haven't already #
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2020-04-17 02:31:42 -05:00
|
|
|
find_package(Git QUIET)
|
|
|
|
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
2024-02-27 05:10:19 -06:00
|
|
|
execute_process(
|
|
|
|
COMMAND git log -1 --pretty=format:%h
|
|
|
|
OUTPUT_VARIABLE RESINSIGHT_GIT_HASH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
|
|
|
|
)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# Update submodules as needed
|
2023-05-19 08:03:04 -05:00
|
|
|
option(RESINSIGHT_UPDATE_SUBMODULES "Check submodules during build" ON)
|
2023-05-21 08:15:09 -05:00
|
|
|
mark_as_advanced(RESINSIGHT_UPDATE_SUBMODULES)
|
|
|
|
|
2023-05-19 08:03:04 -05:00
|
|
|
if(RESINSIGHT_UPDATE_SUBMODULES)
|
2023-01-13 09:01:57 -06:00
|
|
|
set(SUBDIR "${PROJECT_SOURCE_DIR}/ThirdParty")
|
|
|
|
message(STATUS "Initializing GIT submodules")
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- ${SUBDIR}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
RESULT_VARIABLE GIT_SUBMOD_RESULT
|
|
|
|
)
|
|
|
|
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
|
|
|
|
message(
|
|
|
|
FATAL_ERROR
|
|
|
|
"git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules"
|
2021-09-01 01:13:16 -05:00
|
|
|
)
|
2023-01-13 09:01:57 -06:00
|
|
|
endif()
|
2021-04-29 03:42:16 -05:00
|
|
|
endif()
|
2020-04-17 02:31:42 -05:00
|
|
|
endif()
|
2013-01-17 14:26:12 -06:00
|
|
|
|
2023-04-21 09:38:04 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# OpenVDS seismic file access
|
|
|
|
# ##############################################################################
|
2023-04-24 10:10:51 -05:00
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
FetchContent_Declare(
|
|
|
|
openvds
|
2023-12-11 01:28:18 -06:00
|
|
|
URL https://bluware.jfrog.io/artifactory/Releases-OpenVDSPlus/3.2/openvds+-3.2.7-win.zip
|
2023-04-24 10:10:51 -05:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
FetchContent_Declare(
|
|
|
|
openvds
|
2023-12-11 01:28:18 -06:00
|
|
|
URL https://bluware.jfrog.io/artifactory/Releases-OpenVDSPlus/3.2/openvds+-3.2.7-manylinux_2014.tar.gz
|
2023-04-24 10:10:51 -05:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
FetchContent_Populate(openvds)
|
|
|
|
|
|
|
|
set(RESINSIGHT_OPENVDS_API_DIR ${openvds_SOURCE_DIR})
|
2023-04-24 11:23:31 -05:00
|
|
|
message(STATUS "Using OpenVDS api from : ${RESINSIGHT_OPENVDS_API_DIR}")
|
2023-04-24 10:10:51 -05:00
|
|
|
|
2023-04-24 11:23:31 -05:00
|
|
|
if(MSVC)
|
|
|
|
list(APPEND EXTERNAL_LINK_LIBRARIES
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib/msvc_141/openvds.lib
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
list(APPEND EXTERNAL_LINK_LIBRARIES
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libopenvds.so
|
|
|
|
)
|
2023-04-21 09:38:04 -05:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2017-08-17 01:39:02 -05:00
|
|
|
# HDF5
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2017-08-22 15:30:31 -05:00
|
|
|
|
2020-04-24 02:00:42 -05:00
|
|
|
if(MSVC)
|
2023-05-01 11:44:05 -05:00
|
|
|
# this option is disabled in the daily build defined in
|
|
|
|
# ResInsightWithCache.yml, as the text input to ninja becomes too long
|
|
|
|
option(RESINSIGHT_ENABLE_HDF5 "Use external HDF5 library" ON)
|
|
|
|
|
|
|
|
if(RESINSIGHT_ENABLE_HDF5)
|
|
|
|
FetchContent_Declare(
|
|
|
|
hdf-external-lib
|
|
|
|
URL https://github.com/CeetronSolutions/resinsight-dependencies/releases/download/2023.04/HDF_Group.zip
|
|
|
|
)
|
|
|
|
FetchContent_Populate(hdf-external-lib)
|
|
|
|
set(RESINSIGHT_HDF5_DIR ${hdf-external-lib_SOURCE_DIR}/HDF5/1.8.18)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(NOT ${RESINSIGHT_HDF5_DIR} EQUAL "")
|
|
|
|
list(APPEND EXTERNAL_LINK_LIBRARIES ${RESINSIGHT_HDF5_DIR}/lib/hdf5.lib
|
2021-09-01 01:13:16 -05:00
|
|
|
${RESINSIGHT_HDF5_DIR}/lib/hdf5_cpp.lib
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
|
|
|
|
set(RESINSIGHT_FOUND_HDF5 1)
|
|
|
|
message(STATUS "Using HDF5 from : ${RESINSIGHT_HDF5_DIR}")
|
|
|
|
else()
|
|
|
|
message(
|
|
|
|
WARNING
|
|
|
|
"Use of HDF5 is enabled, but RESINSIGHT_HDF5_DIR is empty. Specify RESINSIGHT_HDF5_DIR to be able to use HDF5"
|
|
|
|
)
|
|
|
|
endif()
|
2020-04-24 02:00:42 -05:00
|
|
|
else()
|
2024-08-16 06:50:25 -05:00
|
|
|
if(RESINSIGHT_ENABLE_HDF5)
|
|
|
|
find_package(HDF5 COMPONENTS CXX)
|
|
|
|
if(HDF5_FOUND)
|
|
|
|
list(APPEND EXTERNAL_LINK_LIBRARIES ${HDF5_LIBRARIES})
|
|
|
|
|
|
|
|
set(RESINSIGHT_FOUND_HDF5 1)
|
|
|
|
message(STATUS "Using HDF5 libraries : ${HDF5_LIBRARIES}")
|
|
|
|
|
|
|
|
option(RESINSIGHT_HDF5_BUNDLE_LIBRARIES "Bundle HDF5 libraries" OFF)
|
|
|
|
mark_as_advanced(FORCE RESINSIGHT_HDF5_BUNDLE_LIBRARIES)
|
|
|
|
if(RESINSIGHT_HDF5_BUNDLE_LIBRARIES)
|
|
|
|
message(STATUS "Bundling of HDF5 libraries is enabled")
|
|
|
|
endif() # RESINSIGHT_HDF5_BUNDLE_LIBRARIES
|
|
|
|
|
|
|
|
else()
|
|
|
|
message(WARNING "Use of HDF5 is enabled, but no HDF5 is found.")
|
|
|
|
endif() # HDF5_FOUND
|
|
|
|
endif()
|
2020-04-24 02:00:42 -05:00
|
|
|
endif() # MSVC
|
2017-08-17 01:39:02 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2016-05-27 06:12:31 -05:00
|
|
|
# Opm
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2016-05-27 06:12:31 -05:00
|
|
|
|
2016-09-05 08:23:24 -05:00
|
|
|
add_subdirectory(ThirdParty/custom-opm-flowdiagnostics)
|
2016-12-09 09:25:43 -06:00
|
|
|
add_subdirectory(ThirdParty/custom-opm-flowdiag-app)
|
2015-09-11 10:03:11 -05:00
|
|
|
|
2023-05-01 11:44:05 -05:00
|
|
|
# Option used to build opm-common from source or use precompiled binaries
|
|
|
|
option(RESINSIGHT_BUILD_LIBS_FROM_SOURCE "Build opm-common from source" ON)
|
2023-05-21 08:15:09 -05:00
|
|
|
mark_as_advanced(RESINSIGHT_BUILD_LIBS_FROM_SOURCE)
|
2017-01-21 05:26:21 -06:00
|
|
|
|
2023-05-02 05:32:09 -05:00
|
|
|
if((NOT RESINSIGHT_BUILD_LIBS_FROM_SOURCE) AND MSVC)
|
2023-12-04 07:41:07 -06:00
|
|
|
# See description of URL here
|
|
|
|
# https://docs.github.com/en/repositories/releasing-projects-on-github/linking-to-releases
|
2023-05-02 05:32:09 -05:00
|
|
|
FetchContent_Declare(
|
|
|
|
ri-dependencies
|
2023-12-04 07:41:07 -06:00
|
|
|
URL https://github.com/CeetronSolutions/resinsight-dependencies/releases/latest/download/custom-opm-common.zip
|
2023-05-02 05:32:09 -05:00
|
|
|
)
|
|
|
|
FetchContent_Populate(ri-dependencies)
|
2023-08-28 05:17:34 -05:00
|
|
|
|
2023-08-24 05:54:31 -05:00
|
|
|
add_library(custom-opm-common STATIC IMPORTED)
|
2023-08-28 05:17:34 -05:00
|
|
|
set_target_properties(
|
|
|
|
custom-opm-common
|
|
|
|
PROPERTIES IMPORTED_CONFIGURATIONS "Debug;Release"
|
|
|
|
IMPORTED_LOCATION_DEBUG
|
|
|
|
"${ri-dependencies_SOURCE_DIR}/custom-opm-common_debug.lib"
|
|
|
|
IMPORTED_LOCATION_RELEASE
|
|
|
|
"${ri-dependencies_SOURCE_DIR}/custom-opm-common.lib"
|
|
|
|
)
|
|
|
|
|
2023-08-24 05:54:31 -05:00
|
|
|
list(APPEND EXTERNAL_LINK_LIBRARIES custom-opm-common)
|
2023-08-28 05:17:34 -05:00
|
|
|
|
2023-05-02 05:32:09 -05:00
|
|
|
message(STATUS "opm-common: Enabled use of precompiled library")
|
|
|
|
else()
|
2023-05-01 11:44:05 -05:00
|
|
|
add_subdirectory(ThirdParty/custom-opm-common)
|
|
|
|
add_subdirectory(ThirdParty/custom-opm-common/custom-opm-parser-tests)
|
|
|
|
list(APPEND OPM_LIBRARIES custom-opm-common)
|
|
|
|
set_property(TARGET opm-parser-tests PROPERTY FOLDER "Thirdparty/OPM")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
list(APPEND OPM_LIBRARIES custom-opm-flowdiagnostics custom-opm-flowdiag-app)
|
|
|
|
set_property(TARGET ${OPM_LIBRARIES} PROPERTY FOLDER "Thirdparty/OPM")
|
2017-01-21 05:26:21 -06:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2015-09-11 10:03:11 -05:00
|
|
|
# NRLib
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2015-09-11 10:03:11 -05:00
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/NRLib)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES NRLib)
|
2017-01-21 05:26:21 -06:00
|
|
|
|
2023-03-24 09:36:10 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# openzgy
|
|
|
|
# ##############################################################################
|
|
|
|
|
|
|
|
add_definitions(-DOPENZGY_STATIC)
|
|
|
|
add_subdirectory(ThirdParty/openzgy)
|
|
|
|
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES openzgy)
|
2023-03-27 06:00:26 -05:00
|
|
|
set_property(TARGET zfp PROPERTY FOLDER "Thirdparty")
|
|
|
|
if(TARGET openzgy-tests)
|
|
|
|
set_property(TARGET openzgy-tests PROPERTY FOLDER "Thirdparty")
|
|
|
|
endif()
|
2023-03-24 09:36:10 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2012-05-18 02:45:23 -05:00
|
|
|
# Qt
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2022-03-12 09:43:48 -06:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
find_package(
|
2024-09-30 04:21:17 -05:00
|
|
|
Qt6
|
|
|
|
COMPONENTS
|
|
|
|
REQUIRED
|
|
|
|
Core
|
|
|
|
Gui
|
|
|
|
OpenGL
|
|
|
|
Network
|
|
|
|
Widgets
|
|
|
|
Charts
|
|
|
|
Core5Compat
|
2021-09-01 01:13:16 -05:00
|
|
|
)
|
2024-09-30 04:21:17 -05:00
|
|
|
set(QT_LIBRARIES
|
|
|
|
Qt6::Core
|
|
|
|
Qt6::Gui
|
|
|
|
Qt6::OpenGL
|
|
|
|
Qt6::Network
|
|
|
|
Qt6::Widgets
|
|
|
|
Qt6::Charts
|
|
|
|
Qt6::Core5Compat
|
|
|
|
)
|
|
|
|
qt_standard_project_setup()
|
2013-10-16 06:51:42 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
# Open GL
|
2021-04-29 03:42:16 -05:00
|
|
|
find_package(OpenGL)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2022-01-17 06:14:21 -06:00
|
|
|
# ##############################################################################
|
|
|
|
# QtCharts
|
|
|
|
# ##############################################################################
|
2024-09-30 04:21:17 -05:00
|
|
|
set(RESINSIGHT_USE_QT_CHARTS ON)
|
|
|
|
add_definitions(-DUSE_QTCHARTS)
|
2022-01-17 06:14:21 -06:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2015-08-26 05:27:29 -05:00
|
|
|
# Qwt
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2024-09-30 04:21:17 -05:00
|
|
|
set(USE_QT6 ON)
|
2020-04-24 06:15:11 -05:00
|
|
|
add_subdirectory(ThirdParty/qwt)
|
2015-08-26 05:27:29 -05:00
|
|
|
|
2022-01-26 03:08:28 -06:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2023-04-17 08:57:39 -05:00
|
|
|
target_compile_options(
|
|
|
|
qwt PRIVATE -Wno-deprecated-copy -Wno-deprecated-enum-float-conversion
|
|
|
|
-Wno-deprecated-enum-enum-conversion
|
|
|
|
)
|
2022-01-26 03:08:28 -06:00
|
|
|
elseif(MSVC)
|
|
|
|
target_compile_options(qwt PRIVATE /wd4996 /wd4005)
|
2022-03-15 02:27:07 -05:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(qwt PRIVATE -Wno-deprecated)
|
2022-01-26 03:08:28 -06:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES qwt)
|
2017-01-21 05:26:21 -06:00
|
|
|
|
2022-07-05 04:06:10 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# Qt Advanced Docking System
|
|
|
|
# ##############################################################################
|
2023-12-11 11:16:27 -06:00
|
|
|
set(ADS_VERSION "4.2.1")
|
2024-09-30 04:21:17 -05:00
|
|
|
set(QT_VERSION_MAJOR 6)
|
2022-07-05 04:06:10 -05:00
|
|
|
|
2022-10-18 07:42:35 -05:00
|
|
|
add_subdirectory(ThirdParty/qtadvanceddocking EXCLUDE_FROM_ALL)
|
2022-07-05 04:06:10 -05:00
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
2024-09-30 04:21:17 -05:00
|
|
|
target_compile_options(qt6advanceddocking PRIVATE -Wno-deprecated-copy)
|
2022-07-05 04:06:10 -05:00
|
|
|
elseif(MSVC)
|
2024-09-30 04:21:17 -05:00
|
|
|
target_compile_options(qt6advanceddocking PRIVATE /wd4996 /wd4005)
|
2022-07-05 04:06:10 -05:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2024-09-30 04:21:17 -05:00
|
|
|
target_compile_options(qt6advanceddocking PRIVATE -Wno-deprecated)
|
2022-07-05 04:06:10 -05:00
|
|
|
endif()
|
|
|
|
|
2024-09-30 04:21:17 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES qt6advanceddocking)
|
2022-07-05 04:06:10 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2017-01-21 05:36:14 -06:00
|
|
|
# Nightcharts
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2017-01-21 05:36:14 -06:00
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/nightcharts)
|
2022-01-26 03:08:28 -06:00
|
|
|
if(MSVC)
|
|
|
|
target_compile_options(nightcharts PRIVATE /wd4996)
|
2022-03-15 02:27:07 -05:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(nightcharts PRIVATE -Wno-deprecated)
|
2022-01-26 03:08:28 -06:00
|
|
|
endif()
|
2017-01-21 05:36:14 -06:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES nightcharts)
|
2017-01-21 05:36:14 -06:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# C++ Mathematical Expression Parsing And Evaluation Library
|
|
|
|
# ##############################################################################
|
2017-10-11 12:41:29 -05:00
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/expressionparser)
|
|
|
|
|
2022-01-26 03:08:28 -06:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(expressionparser PUBLIC -Wno-overloaded-virtual)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES expressionparser)
|
2017-08-21 08:24:20 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2018-02-26 14:11:14 -06:00
|
|
|
# clipper
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2017-08-21 15:05:15 -05:00
|
|
|
|
2018-02-26 14:11:14 -06:00
|
|
|
add_subdirectory(ThirdParty/clipper)
|
2017-08-21 15:05:15 -05:00
|
|
|
|
2022-01-26 03:08:28 -06:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(clipper PUBLIC -Wno-deprecated-copy)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES clipper)
|
2017-05-12 07:41:38 -05:00
|
|
|
|
2022-12-19 08:28:26 -06:00
|
|
|
# ##############################################################################
|
|
|
|
# roffcpp
|
|
|
|
# ##############################################################################
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/roffcpp)
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES roffcpp)
|
2023-01-24 05:29:27 -06:00
|
|
|
set_property(TARGET roffcpp-tests gtest gtest_main PROPERTY FOLDER "Thirdparty")
|
2022-12-19 08:28:26 -06:00
|
|
|
|
2023-05-12 09:02:56 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# regression-analysis
|
|
|
|
# ##############################################################################
|
|
|
|
|
2023-05-16 01:26:12 -05:00
|
|
|
set(REGRESSION_FETCH_EIGEN false)
|
2023-05-12 09:02:56 -05:00
|
|
|
add_subdirectory(ThirdParty/regression-analysis)
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES regression-analysis)
|
|
|
|
set_property(
|
|
|
|
TARGET regression-analysis-tests gtest gtest_main PROPERTY FOLDER
|
|
|
|
"Thirdparty"
|
|
|
|
)
|
|
|
|
|
2023-11-24 04:42:31 -06:00
|
|
|
# ##############################################################################
|
|
|
|
# toml++
|
|
|
|
# ##############################################################################
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/tomlplusplus)
|
|
|
|
|
2024-01-15 10:51:03 -06:00
|
|
|
# ##############################################################################
|
2024-08-14 06:31:12 -05:00
|
|
|
# spdlog and fast_float
|
2024-01-15 10:51:03 -06:00
|
|
|
# ##############################################################################
|
|
|
|
|
2024-08-14 06:31:12 -05:00
|
|
|
find_package(FastFloat CONFIG REQUIRED)
|
|
|
|
find_package(spdlog CONFIG REQUIRED)
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES FastFloat::fast_float spdlog::spdlog)
|
2024-01-15 10:51:03 -06:00
|
|
|
|
2024-05-22 04:14:12 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# Arrow
|
|
|
|
# ##############################################################################
|
|
|
|
find_package(Arrow CONFIG REQUIRED)
|
|
|
|
if(MSVC)
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES Arrow::arrow_shared)
|
|
|
|
else()
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES Arrow::arrow_static)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# ##############################################################################
|
|
|
|
# Parquet
|
|
|
|
# ##############################################################################
|
|
|
|
find_package(Parquet CONFIG REQUIRED)
|
|
|
|
if(MSVC)
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES Parquet::parquet_shared)
|
|
|
|
else()
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES Parquet::parquet_static)
|
|
|
|
endif()
|
|
|
|
|
2024-07-01 04:33:40 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# nonstd::type-lite
|
|
|
|
# ##############################################################################
|
|
|
|
find_package(type-lite CONFIG REQUIRED)
|
|
|
|
list(APPEND THIRD_PARTY_LIBRARIES nonstd::type-lite)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2020-04-27 04:10:39 -05:00
|
|
|
# Thirdparty libraries are put in ThirdParty solution folder
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
|
|
|
set_property(TARGET ${THIRD_PARTY_LIBRARIES} PROPERTY FOLDER "Thirdparty")
|
2020-04-27 04:10:39 -05:00
|
|
|
|
2024-02-11 13:04:04 -06:00
|
|
|
# ##############################################################################
|
|
|
|
# Build list of DLLs needed for executables
|
|
|
|
# ##############################################################################
|
|
|
|
if(MSVC)
|
|
|
|
|
|
|
|
if(NOT ${RESINSIGHT_ODB_API_DIR} EQUAL "")
|
|
|
|
set(RESINSIGHT_USE_ODB_API 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Odb Dlls
|
|
|
|
if(RESINSIGHT_USE_ODB_API)
|
|
|
|
# Find all the dlls
|
|
|
|
file(GLOB RI_ALL_ODB_DLLS ${RESINSIGHT_ODB_API_DIR}/lib/*.dll)
|
|
|
|
|
|
|
|
# Strip off the path
|
|
|
|
foreach(aDLL ${RI_ALL_ODB_DLLS})
|
|
|
|
get_filename_component(filenameWithExt ${aDLL} NAME)
|
|
|
|
list(APPEND RI_ODB_DLLS ${filenameWithExt})
|
|
|
|
endforeach(aDLL)
|
|
|
|
|
|
|
|
foreach(aDLL ${RI_ODB_DLLS})
|
|
|
|
list(APPEND RI_FILENAMES ${RESINSIGHT_ODB_API_DIR}/lib/${aDLL})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# OpenVDS Dlls
|
|
|
|
set(OPENVDS_DLL_NAMES openvds segyutils)
|
|
|
|
foreach(OPENVDS_DLL_NAME ${OPENVDS_DLL_NAMES})
|
|
|
|
list(APPEND RI_FILENAMES
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/bin/msvc_141/${OPENVDS_DLL_NAME}.dll
|
|
|
|
)
|
|
|
|
endforeach(OPENVDS_DLL_NAME)
|
|
|
|
list(APPEND RI_FILENAMES
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/bin/msvc_141/SEGYImport.exe
|
|
|
|
)
|
|
|
|
|
|
|
|
# HDF5 Dlls
|
|
|
|
if(RESINSIGHT_FOUND_HDF5)
|
|
|
|
set(HDF5_DLL_NAMES hdf5 hdf5_cpp szip zlib)
|
|
|
|
foreach(HDF5_DLL_NAME ${HDF5_DLL_NAMES})
|
|
|
|
list(APPEND RI_FILENAMES ${RESINSIGHT_HDF5_DIR}/bin/${HDF5_DLL_NAME}.dll)
|
|
|
|
endforeach(HDF5_DLL_NAME)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
else()
|
|
|
|
# Linux
|
|
|
|
|
|
|
|
# OpenVDS lib files
|
|
|
|
list(APPEND RI_FILENAMES ${RESINSIGHT_OPENVDS_API_DIR}/bin/SEGYImport)
|
|
|
|
|
|
|
|
set(OPENVDS_LIB_NAMES
|
|
|
|
libopenvds.so
|
|
|
|
libopenvds.so.3
|
|
|
|
libopenvds.so.3.2.7
|
|
|
|
libopenvds-e1541338.so.3.2.7
|
|
|
|
libsegyutils.so
|
|
|
|
libsegyutils.so.3
|
|
|
|
libsegyutils.so.3.2.7
|
|
|
|
)
|
|
|
|
foreach(OPENVDS_LIB_NAME ${OPENVDS_LIB_NAMES})
|
|
|
|
list(APPEND RI_FILENAMES
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/${OPENVDS_LIB_NAME}
|
|
|
|
)
|
|
|
|
endforeach(OPENVDS_LIB_NAME)
|
|
|
|
endif(MSVC)
|
|
|
|
|
2022-07-07 05:03:02 -05:00
|
|
|
# ##############################################################################
|
|
|
|
# Unity Build
|
|
|
|
# ##############################################################################
|
|
|
|
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
|
|
|
message("Cmake Unity build is enabled on : qwt")
|
|
|
|
set_property(TARGET qwt PROPERTY UNITY_BUILD true)
|
|
|
|
message("Cmake Unity build is enabled on : custom-opm-flowdiagnostics")
|
|
|
|
set_property(TARGET custom-opm-flowdiagnostics PROPERTY UNITY_BUILD true)
|
2022-07-07 09:42:06 -05:00
|
|
|
# message("Cmake Unity build is enabled on : custom-opm-common")
|
|
|
|
# set_property(TARGET custom-opm-common PROPERTY UNITY_BUILD true)
|
2022-07-07 05:03:02 -05:00
|
|
|
message("Cmake Unity build is enabled on : qtadvanceddocking")
|
2024-09-30 04:21:17 -05:00
|
|
|
set_property(TARGET qt6advanceddocking PROPERTY UNITY_BUILD true)
|
2022-07-07 05:03:02 -05:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2014-04-11 04:29:31 -05:00
|
|
|
# Vizualization Framework
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
add_subdirectory(${VIZ_MODULES_FOLDER_NAME}/LibCore)
|
|
|
|
add_subdirectory(${VIZ_MODULES_FOLDER_NAME}/LibGeometry)
|
|
|
|
add_subdirectory(${VIZ_MODULES_FOLDER_NAME}/LibRender)
|
|
|
|
add_subdirectory(${VIZ_MODULES_FOLDER_NAME}/LibViewing)
|
|
|
|
add_subdirectory(${VIZ_MODULES_FOLDER_NAME}/LibGuiQt)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(
|
|
|
|
APPEND
|
|
|
|
VIZ_FWK_LIBRARIES
|
|
|
|
LibGuiQt
|
|
|
|
LibViewing
|
|
|
|
LibRender
|
|
|
|
LibGeometry
|
2021-09-01 01:13:16 -05:00
|
|
|
LibCore
|
|
|
|
)
|
2015-04-29 03:50:25 -05:00
|
|
|
|
2022-01-26 03:08:28 -06:00
|
|
|
if(MSVC)
|
|
|
|
target_compile_options(LibGuiQt PRIVATE /wd4996)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
target_compile_options(
|
|
|
|
LibRender PRIVATE -Wno-undefined-var-template -Wno-invalid-source-encoding
|
|
|
|
-Wno-null-pointer-arithmetic
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
set_property(TARGET ${VIZ_FWK_LIBRARIES} PROPERTY FOLDER "VizFwk")
|
2024-01-29 08:41:54 -06:00
|
|
|
if(WIN32)
|
|
|
|
set_property(TARGET run_Glsl2Include PROPERTY FOLDER "VizFwk")
|
|
|
|
endif()
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2014-04-11 04:29:31 -05:00
|
|
|
# Application Framework
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-09-20 09:21:46 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafAnimControl)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafViewer)
|
2015-07-29 07:20:15 -05:00
|
|
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafPdmCore)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafPdmXml)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafProjectDataModel)
|
2024-06-28 05:33:19 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafDataLoader)
|
2015-07-29 07:20:15 -05:00
|
|
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafCommand)
|
2013-09-20 09:21:46 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafUserInterface)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafPdmCvf)
|
2022-01-26 03:08:28 -06:00
|
|
|
|
2015-07-29 07:20:15 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/CommonCode)
|
2016-08-02 03:25:55 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafVizExtensions)
|
2022-01-26 03:08:28 -06:00
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafPdmScripting)
|
2019-11-15 08:32:15 -06:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafCommandFeatures)
|
|
|
|
|
2015-07-29 07:20:15 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafTensor)
|
2020-01-17 06:23:37 -06:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafHexInterpolator)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2022-01-26 03:08:28 -06:00
|
|
|
if(MSVC)
|
2023-01-24 05:29:27 -06:00
|
|
|
target_compile_options(cafAnimControl PRIVATE /wd5054)
|
|
|
|
target_compile_options(cafViewer PRIVATE /wd4996 /wd5054)
|
2022-01-26 03:08:28 -06:00
|
|
|
target_compile_options(cafPdmCore PRIVATE /wd4996)
|
2023-01-24 05:29:27 -06:00
|
|
|
target_compile_options(cafPdmUiCore PRIVATE /wd5054)
|
|
|
|
target_compile_options(cafCommandFeatures PRIVATE /wd4996 /wd5054)
|
|
|
|
target_compile_options(cafCommand PRIVATE /wd5054)
|
2022-01-26 03:08:28 -06:00
|
|
|
target_compile_options(cafPdmXml PRIVATE /wd4996)
|
2023-01-24 05:29:27 -06:00
|
|
|
target_compile_options(cafUserInterface PRIVATE /wd4996 /wd5054)
|
|
|
|
target_compile_options(qwt PRIVATE /wd5055)
|
|
|
|
target_compile_options(CommonCode PRIVATE /wd5054)
|
2022-01-26 03:08:28 -06:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
|
target_compile_options(cafCommandFeatures PRIVATE -Wno-deprecated-copy)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
target_compile_options(
|
|
|
|
CommonCode PRIVATE -Wno-deprecated-copy -Wno-undefined-var-template
|
|
|
|
)
|
|
|
|
target_compile_options(
|
|
|
|
cafCommandFeatures PRIVATE -Wno-deprecated-copy -Wno-undefined-var-template
|
2023-05-21 08:15:09 -05:00
|
|
|
-Wno-deprecated-enum-enum-conversion
|
2022-01-26 03:08:28 -06:00
|
|
|
)
|
|
|
|
target_compile_options(
|
|
|
|
cafVizExtensions PRIVATE -Wno-deprecated-copy -Wno-undefined-var-template
|
|
|
|
-Wno-invalid-source-encoding
|
|
|
|
)
|
|
|
|
target_compile_options(cafUserInterface PRIVATE -Wno-null-pointer-arithmetic)
|
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
list(
|
|
|
|
APPEND
|
|
|
|
APP_FWK_LIBRARIES
|
|
|
|
cafPdmCore
|
|
|
|
cafPdmUiCore
|
|
|
|
cafPdmXml
|
|
|
|
cafProjectDataModel
|
|
|
|
cafUserInterface
|
|
|
|
cafViewer
|
|
|
|
cafAnimControl
|
|
|
|
cafCommand
|
|
|
|
cafPdmCvf
|
|
|
|
cafTensor
|
2024-06-28 05:33:19 -05:00
|
|
|
cafDataLoader
|
2021-04-29 03:42:16 -05:00
|
|
|
CommonCode
|
|
|
|
cafVizExtensions
|
2021-09-01 01:13:16 -05:00
|
|
|
cafPdmScripting
|
2023-03-23 09:49:06 -05:00
|
|
|
cafCommandFeatures
|
2021-09-01 01:13:16 -05:00
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
|
|
|
|
set_property(TARGET ${APP_FWK_LIBRARIES} PROPERTY FOLDER "AppFwk")
|
|
|
|
|
|
|
|
option(RESINSIGHT_INCLUDE_APPFWK_TESTS "Enable AppFwk Tests" OFF)
|
2019-08-12 01:51:26 -05:00
|
|
|
mark_as_advanced(FORCE RESINSIGHT_INCLUDE_APPFWK_TESTS)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(RESINSIGHT_INCLUDE_APPFWK_TESTS)
|
|
|
|
# Unit Tests
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests)
|
|
|
|
add_subdirectory(
|
2021-09-01 01:13:16 -05:00
|
|
|
Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests)
|
2022-05-29 01:55:45 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# Executables
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafTests/cafTestApplication)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafTests/cafTestCvfApplication)
|
2023-03-23 09:49:06 -05:00
|
|
|
|
|
|
|
list(
|
|
|
|
APPEND
|
|
|
|
APP_FWK_TEST_PROJECTS
|
|
|
|
cafProjectDataModel_UnitTests
|
|
|
|
cafPdmCore_UnitTests
|
|
|
|
cafPdmXml_UnitTests
|
|
|
|
cafPdmScripting_UnitTests
|
|
|
|
cafUserInterface_UnitTests
|
|
|
|
cafTestApplication
|
|
|
|
cafTestCvfApplication
|
|
|
|
)
|
|
|
|
|
|
|
|
set_property(TARGET ${APP_FWK_TEST_PROJECTS} PROPERTY FOLDER "AppFwkTests")
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
endif()
|
2016-06-06 02:56:45 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2012-05-18 02:45:23 -05:00
|
|
|
# Installation settings
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2012-09-11 08:10:28 -05:00
|
|
|
|
2024-09-30 04:21:17 -05:00
|
|
|
# Set the install folder to be the bin folder. TODO: Move Python scripts to a
|
|
|
|
# separate folder
|
|
|
|
set(RESINSIGHT_INSTALL_FOLDER "bin")
|
2012-09-11 08:10:28 -05:00
|
|
|
|
2013-03-26 17:00:09 -05:00
|
|
|
# override system install prefix if private installation chosen
|
2021-04-29 03:42:16 -05:00
|
|
|
option(RESINSIGHT_PRIVATE_INSTALL
|
2024-04-22 12:56:10 -05:00
|
|
|
"Linux only: Install the resdata shared libraries along the executable"
|
2021-09-01 01:13:16 -05:00
|
|
|
ON
|
|
|
|
)
|
2018-01-05 07:21:02 -06:00
|
|
|
mark_as_advanced(FORCE RESINSIGHT_PRIVATE_INSTALL)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
if(RESINSIGHT_PRIVATE_INSTALL)
|
2021-04-05 10:33:58 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ############################################################################
|
|
|
|
# ERT shared library files Install procedure will copy so-files from ERT into
|
|
|
|
# same install folder as ResInsight
|
|
|
|
# ############################################################################
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(ERT_SHARED_LIB_FILES
|
2024-04-22 12:56:10 -05:00
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libresdata.so
|
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libresdata.so.2
|
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libresdata.so.2.4
|
2021-04-29 03:42:16 -05:00
|
|
|
)
|
|
|
|
install(FILES ${ERT_SHARED_LIB_FILES}
|
2021-09-01 01:13:16 -05:00
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
set(ERT_SHARED_LIB_FILES
|
2024-04-22 12:56:10 -05:00
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libresdata.dylib
|
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libresdata.2.dylib
|
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libresdata.2.4.dylib
|
2021-04-29 03:42:16 -05:00
|
|
|
)
|
|
|
|
install(
|
|
|
|
FILES ${ERT_SHARED_LIB_FILES}
|
2021-09-01 01:13:16 -05:00
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/ResInsight.app/Contents/MacOS
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
endif()
|
2019-04-08 03:36:29 -05:00
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
endif(RESINSIGHT_PRIVATE_INSTALL)
|
|
|
|
|
|
|
|
if(RESINSIGHT_HDF5_BUNDLE_LIBRARIES)
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
# find all file names with text hdf5 use file globbing to also copy the
|
|
|
|
# symlinks to make sure the dependencies from ResInsight runtime is correct
|
|
|
|
foreach(FILE_TO_COPY ${HDF5_LIBRARIES})
|
|
|
|
string(FIND ${FILE_TO_COPY} "hdf5" POS_IN_STRING)
|
|
|
|
if(${POS_IN_STRING} GREATER -1)
|
|
|
|
file(GLOB FILE_AND_SYMLINKS ${FILE_TO_COPY}*)
|
|
|
|
install(FILES ${FILE_AND_SYMLINKS}
|
2021-09-01 01:13:16 -05:00
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endif(RESINSIGHT_HDF5_BUNDLE_LIBRARIES)
|
|
|
|
|
|
|
|
if(RESINSIGHT_BUNDLE_TESTMODELS)
|
|
|
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/TestModels
|
2021-09-01 01:13:16 -05:00
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
)
|
2021-01-14 04:10:55 -06:00
|
|
|
endif()
|
2016-06-02 05:50:42 -05:00
|
|
|
|
2023-04-24 11:23:31 -05:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(OPENVDS_SHARED_LIB_FILES
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libopenvds.so
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libopenvds.so.3
|
2023-12-11 01:28:18 -06:00
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libopenvds.so.3.2.7
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libopenvds-e1541338.so.3.2.7
|
2023-04-24 11:23:31 -05:00
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libsegyutils.so
|
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libsegyutils.so.3
|
2023-12-11 01:28:18 -06:00
|
|
|
${RESINSIGHT_OPENVDS_API_DIR}/lib64/libsegyutils.so.3.2.7
|
2023-04-24 11:23:31 -05:00
|
|
|
)
|
|
|
|
install(FILES ${OPENVDS_SHARED_LIB_FILES}
|
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
)
|
2023-04-24 10:10:51 -05:00
|
|
|
|
2023-04-24 11:23:31 -05:00
|
|
|
install(PROGRAMS ${RESINSIGHT_OPENVDS_API_DIR}/bin/SEGYImport
|
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
)
|
2023-04-24 10:10:51 -05:00
|
|
|
endif()
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2021-01-06 08:03:38 -06:00
|
|
|
# Application
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2021-01-06 08:03:38 -06:00
|
|
|
add_subdirectory(ApplicationLibCode)
|
2023-04-25 06:14:26 -05:00
|
|
|
add_subdirectory(ApplicationLibCode/Commands)
|
|
|
|
add_subdirectory(ApplicationLibCode/ResultStatisticsCache)
|
|
|
|
add_subdirectory(ApplicationLibCode/GeoMech/GeoMechDataModel)
|
2024-01-03 04:55:35 -06:00
|
|
|
add_subdirectory(ApplicationLibCode/GeoMech/GeoMechFileInterface)
|
2023-04-25 06:14:26 -05:00
|
|
|
if(RESINSIGHT_USE_ODB_API)
|
|
|
|
add_subdirectory(ApplicationLibCode/GeoMech/OdbReader)
|
|
|
|
endif()
|
|
|
|
|
2021-01-06 08:03:38 -06:00
|
|
|
if(RESINSIGHT_ENABLE_GRPC)
|
2021-04-29 03:42:16 -05:00
|
|
|
add_subdirectory(GrpcInterface)
|
2021-01-06 08:03:38 -06:00
|
|
|
endif()
|
|
|
|
add_subdirectory(ApplicationExeCode)
|
2019-01-04 06:58:39 -06:00
|
|
|
|
2024-06-04 00:42:50 -05:00
|
|
|
option(RESINSIGHT_USE_EXTERNAL_OCTAVE_PLUGINS "Use external Octave plugins" OFF)
|
|
|
|
if(RESINSIGHT_USE_EXTERNAL_OCTAVE_PLUGINS)
|
|
|
|
FetchContent_Declare(
|
|
|
|
external-octave_plugins
|
|
|
|
URL https://github.com/CeetronSolutions/resinsight-dependencies/releases/latest/download/OctavePlugins-0.1.1-Linux.tar.gz
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
|
2024-06-04 00:42:50 -05:00
|
|
|
FetchContent_Populate(external-octave_plugins)
|
|
|
|
|
|
|
|
file(GLOB FILE_AND_SYMLINKS ${external-octave_plugins_SOURCE_DIR}/*.oct)
|
|
|
|
install(
|
|
|
|
FILES ${FILE_AND_SYMLINKS}
|
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
OPTIONAL
|
2021-09-01 01:13:16 -05:00
|
|
|
)
|
2024-06-04 00:42:50 -05:00
|
|
|
else(RESINSIGHT_USE_EXTERNAL_OCTAVE_PLUGINS)
|
|
|
|
if(OCTAVE_MKOCTFILE)
|
|
|
|
message(STATUS "Adding OctavePlugin library")
|
|
|
|
|
2024-10-04 08:28:42 -05:00
|
|
|
# add_subdirectory(Octave/OctavePlugin)
|
2024-06-04 00:42:50 -05:00
|
|
|
else(OCTAVE_MKOCTFILE)
|
|
|
|
message(
|
|
|
|
STATUS "Could not find OCTAVE_MKOCTFILE, skipping OctavePlugin library"
|
|
|
|
)
|
|
|
|
endif(OCTAVE_MKOCTFILE)
|
|
|
|
endif(RESINSIGHT_USE_EXTERNAL_OCTAVE_PLUGINS)
|
2012-09-20 08:15:43 -05:00
|
|
|
|
2024-05-04 06:21:31 -05:00
|
|
|
add_subdirectory(ThirdParty/extract-projectfile-versions)
|
|
|
|
install(TARGETS extract-projectfile-versions
|
|
|
|
DESTINATION ${RESINSIGHT_INSTALL_FOLDER}
|
|
|
|
)
|
|
|
|
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
2023-02-13 07:03:19 -06:00
|
|
|
# Visual Studio : Create the ruleset file to be used by Static Code Analysis
|
|
|
|
# https://stackoverflow.com/questions/75031903/how-to-enable-static-analysis-with-custom-ruleset-in-msvc-via-cmakelists-txt
|
|
|
|
# ##############################################################################
|
|
|
|
|
|
|
|
option(RESINSIGHT_ENABLE_STATIC_ANALYSIS "Enable static analysis" OFF)
|
|
|
|
if(MSVC AND RESINSIGHT_ENABLE_STATIC_ANALYSIS)
|
|
|
|
set(RULESET_FILE ${CMAKE_CURRENT_BINARY_DIR}/msvc-ruleset.props)
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_SOURCE_DIR}/scripts/static-code-analysis/msvc-property-sheet-template.props
|
|
|
|
${RULESET_FILE}
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
set(TARGETS_FOR_STATIC_ANALYSIS
|
2024-01-03 04:55:35 -06:00
|
|
|
${APP_FWK_LIBRARIES}
|
|
|
|
${APP_FWK_TEST_PROJECTS}
|
|
|
|
ApplicationLibCode
|
|
|
|
Commands
|
|
|
|
ResultStatisticsCache
|
|
|
|
RigGeoMechDataModel
|
|
|
|
RifGeoMechFileInterface
|
2023-02-13 07:03:19 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
foreach(TARGET_PROJECT ${TARGETS_FOR_STATIC_ANALYSIS})
|
|
|
|
set_property(
|
|
|
|
TARGET ${TARGET_PROJECT} PROPERTY VS_USER_PROPS "${RULESET_FILE}"
|
|
|
|
)
|
|
|
|
target_compile_options(
|
|
|
|
${TARGET_PROJECT} PRIVATE /external:anglebrackets /analyze:external-
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endif(MSVC AND RESINSIGHT_ENABLE_STATIC_ANALYSIS)
|
|
|
|
|
|
|
|
# ##############################################################################
|
2013-04-19 01:54:38 -05:00
|
|
|
# Code documentation using Doxygen
|
2021-04-29 03:42:16 -05:00
|
|
|
# ##############################################################################
|
|
|
|
option(RESINSIGHT_BUILD_DOCUMENTATION
|
2021-09-01 01:13:16 -05:00
|
|
|
"Use Doxygen to create the HTML based API documentation" OFF
|
|
|
|
)
|
2013-04-19 01:54:38 -05:00
|
|
|
if(RESINSIGHT_BUILD_DOCUMENTATION)
|
2021-04-29 03:42:16 -05:00
|
|
|
find_package(Doxygen)
|
|
|
|
if(NOT DOXYGEN_FOUND)
|
|
|
|
message(
|
|
|
|
FATAL_ERROR
|
|
|
|
"Doxygen is needed to build the documentation. Please install it correctly"
|
|
|
|
)
|
2013-04-19 01:54:38 -05:00
|
|
|
endif()
|
2021-04-29 03:42:16 -05:00
|
|
|
# -- Configure the Template Doxyfile for our specific project
|
|
|
|
configure_file(Doxyfile.in ${PROJECT_BINARY_DIR}/Doxyfile @ONLY IMMEDIATE)
|
|
|
|
# -- Add a custom target to run Doxygen when ever the project is built
|
|
|
|
add_custom_target(
|
|
|
|
Docs
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
|
2021-09-01 01:13:16 -05:00
|
|
|
SOURCES ${PROJECT_BINARY_DIR}/Doxyfile
|
|
|
|
)
|
2021-04-29 03:42:16 -05:00
|
|
|
# IF you do NOT want the documentation to be generated EVERY time you build
|
|
|
|
# the project then leave out the 'ALL' keyword from the above command.
|
2013-04-19 01:54:38 -05:00
|
|
|
endif(RESINSIGHT_BUILD_DOCUMENTATION)
|