2012-05-18 02:45:23 -05:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
|
2014-08-12 08:02:19 -05:00
|
|
|
include (CheckCSourceCompiles)
|
2012-05-18 02:45:23 -05:00
|
|
|
project (ResInsight)
|
|
|
|
|
2013-09-20 09:21:46 -05:00
|
|
|
set (VIZ_MODULES_FOLDER_NAME Fwk/VizFwk)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-12 08:27:18 -05:00
|
|
|
|
2013-10-07 00:23:04 -05:00
|
|
|
################################################################################
|
2012-05-18 02:45:23 -05:00
|
|
|
# Setup the main platform defines
|
2013-10-07 00:23:04 -05:00
|
|
|
################################################################################
|
2012-05-18 02:45:23 -05:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
add_definitions(-DCVF_LINUX)
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
add_definitions(-DCVF_OSX)
|
|
|
|
else()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
|
|
|
endif()
|
|
|
|
|
2013-10-07 00:23:04 -05:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(CMAKE_CXX_FLAGS "-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat")
|
|
|
|
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
|
|
|
|
2013-10-07 00:23:04 -05:00
|
|
|
################################################################################
|
|
|
|
# OpenMP
|
|
|
|
################################################################################
|
|
|
|
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}")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
|
|
|
|
else()
|
|
|
|
message(STATUS "Disabling OpenMP support")
|
|
|
|
endif()
|
|
|
|
endif()
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
2013-01-22 02:30:28 -06:00
|
|
|
# Version number
|
2012-05-18 02:45:23 -05:00
|
|
|
################################################################################
|
2013-01-22 02:30:28 -06:00
|
|
|
include (ResInsightVersion.cmake)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2012-09-11 02:22:36 -05:00
|
|
|
|
2013-01-17 06:33:59 -06:00
|
|
|
################################################################################
|
|
|
|
# ERT
|
|
|
|
################################################################################
|
2013-04-04 04:27:38 -05:00
|
|
|
|
|
|
|
# Disable install of ERT libs and headers, as Ert code is compiled and linked directly
|
2013-10-07 00:23:04 -05:00
|
|
|
SET(INSTALL_ERT OFF CACHE BOOL "ERT: Install library")
|
2015-10-30 04:03:09 -05:00
|
|
|
SET(BUILD_PYTHON OFF CACHE BOOL "ERT: Run py_compile on the python wrappers")
|
2013-10-07 07:15:09 -05:00
|
|
|
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "ERT: Build shared libraries")
|
2013-10-07 06:31:13 -05:00
|
|
|
SET(ERT_USE_OPENMP ${OPENMP_FOUND} CACHE BOOL "ERT: Compile using OpenMP")
|
2016-04-19 08:09:13 -05:00
|
|
|
SET(ERT_BUILD_CXX OFF CACHE BOOL "ERT: Disable build of CXX wrappers")
|
2013-04-04 04:27:38 -05:00
|
|
|
|
2015-01-07 02:16:35 -06:00
|
|
|
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(
|
2013-01-31 08:55:49 -06:00
|
|
|
${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
|
2015-01-07 02:16:35 -06:00
|
|
|
${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include
|
2013-01-31 08:55:49 -06:00
|
|
|
${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
|
2015-01-07 02:16:35 -06:00
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util
|
2013-01-31 08:55:49 -06:00
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include
|
2015-01-07 02:16:35 -06:00
|
|
|
)
|
|
|
|
endif (ERT_EXTERNAL)
|
2013-01-17 14:26:12 -06:00
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
set_property(TARGET
|
|
|
|
ecl
|
|
|
|
ecl_well
|
|
|
|
ert_geometry
|
|
|
|
ert_util
|
|
|
|
PROPERTY FOLDER "ERT"
|
|
|
|
)
|
2013-01-17 14:26:12 -06:00
|
|
|
|
2015-09-11 10:03:11 -05:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# NRLib
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/NRLib)
|
2015-09-14 09:33:28 -05:00
|
|
|
include_directories(ThirdParty/NRLib/nrlib/well)
|
2015-09-11 10:03:11 -05:00
|
|
|
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
################################################################################
|
|
|
|
# Qt
|
|
|
|
################################################################################
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
set (QT_COMPONENTS_REQUIRED QtCore QtGui QtMain QtOpenGl QtNetwork QtScript QtScriptTools)
|
2013-10-16 06:51:42 -05:00
|
|
|
find_package (Qt4 COMPONENTS ${QT_COMPONENTS_REQUIRED})
|
2013-10-16 07:16:35 -05:00
|
|
|
if ( NOT QT4_FOUND )
|
2013-10-16 06:51:42 -05:00
|
|
|
message(FATAL_ERROR "Package Qt4 is required, but not found. Please specify qmake for variable QT_QMAKE_EXECUTABLE")
|
2013-10-16 07:16:35 -05:00
|
|
|
endif ( NOT QT4_FOUND )
|
2013-10-16 06:51:42 -05:00
|
|
|
|
|
|
|
if (QT_VERSION_MINOR LESS 6)
|
|
|
|
message(FATAL_ERROR "Qt 4.6 is required, please specify qmake for variable QT_QMAKE_EXECUTABLE")
|
|
|
|
endif()
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
include (${QT_USE_FILE})
|
|
|
|
|
|
|
|
# Open GL
|
|
|
|
find_package( OpenGL )
|
|
|
|
|
2015-08-26 05:27:29 -05:00
|
|
|
################################################################################
|
|
|
|
# Qwt
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/Qwt/src)
|
|
|
|
include_directories(ThirdParty/Qwt/src)
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
################################################################################
|
2014-04-11 04:29:31 -05:00
|
|
|
# Vizualization Framework
|
2012-05-18 02:45:23 -05:00
|
|
|
################################################################################
|
2014-04-11 04:29:31 -05:00
|
|
|
|
|
|
|
# Allow use of non-threadsafe reference counter in cvf::Object on systems with no atomics support
|
2014-04-15 01:51:18 -05:00
|
|
|
if (CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
|
2014-04-15 04:50:04 -05:00
|
|
|
if (NOT DEFINED HAVE_GCC_SYNC_FUNCTIONS)
|
2014-04-15 02:48:32 -05:00
|
|
|
check_c_source_compiles("int main(int argc, char **argv) {
|
|
|
|
int a;
|
|
|
|
__sync_add_and_fetch(&a, 1);
|
|
|
|
__sync_fetch_and_add(&a, 1);
|
|
|
|
__sync_sub_and_fetch(&a, 1);
|
2014-04-15 04:50:04 -05:00
|
|
|
__sync_fetch_and_sub(&a, 1); }" HAVE_GCC_SYNC_FUNCTIONS)
|
2014-04-15 02:48:32 -05:00
|
|
|
endif()
|
2014-04-15 01:51:18 -05:00
|
|
|
|
2014-04-15 04:50:04 -05:00
|
|
|
if (HAVE_GCC_SYNC_FUNCTIONS)
|
|
|
|
message("GCC synchronization functions detected")
|
2014-04-15 02:48:32 -05:00
|
|
|
else()
|
2014-04-15 04:50:04 -05:00
|
|
|
message("GCC synchronization functions NOT detected, fallback to non threadsafe reference counting")
|
|
|
|
add_definitions(-DCVF_USE_NON_THREADSAFE_REFERENCE_COUNT)
|
2014-04-15 01:51:18 -05:00
|
|
|
endif()
|
|
|
|
|
2014-04-11 04:29:31 -05:00
|
|
|
endif()
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${LibCore_SOURCE_DIR}
|
|
|
|
${LibGeometry_SOURCE_DIR}
|
|
|
|
${LibRender_SOURCE_DIR}
|
|
|
|
${LibViewing_SOURCE_DIR}
|
|
|
|
${LibGuiQt_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
set_property(TARGET
|
|
|
|
LibCore
|
|
|
|
LibGeometry
|
|
|
|
LibGuiQt
|
|
|
|
LibRender
|
|
|
|
LibViewing
|
|
|
|
PROPERTY FOLDER "VizFwk"
|
|
|
|
)
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
################################################################################
|
2014-04-11 04:29:31 -05:00
|
|
|
# Application Framework
|
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)
|
|
|
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafCommand)
|
2013-09-20 09:21:46 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafUserInterface)
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafPdmCvf)
|
2015-07-29 07:20:15 -05:00
|
|
|
add_subdirectory(Fwk/AppFwk/CommonCode)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-11-26 07:18:11 -06:00
|
|
|
#add_subdirectory(Fwk/AppFwk/cafTests/cafTestCvfApplication)
|
2015-07-29 07:20:15 -05:00
|
|
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafTensor)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-04-29 03:50:25 -05:00
|
|
|
set_property(TARGET
|
2015-07-29 07:20:15 -05:00
|
|
|
cafAnimControl
|
|
|
|
cafViewer
|
|
|
|
|
|
|
|
cafPdmCore
|
|
|
|
cafPdmUiCore
|
|
|
|
cafPdmXml
|
2015-04-29 03:50:25 -05:00
|
|
|
cafProjectDataModel
|
2015-07-29 07:20:15 -05:00
|
|
|
|
|
|
|
cafCommand
|
2015-04-29 03:50:25 -05:00
|
|
|
cafUserInterface
|
2015-06-17 05:55:08 -05:00
|
|
|
cafTensor
|
2015-07-29 07:20:15 -05:00
|
|
|
cafPdmCvf
|
2015-04-29 03:50:25 -05:00
|
|
|
CommonCode
|
|
|
|
PROPERTY FOLDER "AppFwk"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
################################################################################
|
|
|
|
# Installation settings
|
|
|
|
################################################################################
|
2012-09-11 08:10:28 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
set (RESINSIGHT_FINAL_NAME "ResInsight-${STRPRODUCTVER}")
|
2012-09-11 08:10:28 -05:00
|
|
|
|
|
|
|
# Append el5 when compiled on RHEL5 and el6 if compiled on RHEL6
|
|
|
|
string(REGEX MATCH "el[5,6]?" RESINSIGHT_PLATFORM ${CMAKE_SYSTEM})
|
|
|
|
if (NOT "${RESINSIGHT_PLATFORM}" STREQUAL "")
|
|
|
|
set (RESINSIGHT_FINAL_NAME "${RESINSIGHT_FINAL_NAME}-${RESINSIGHT_PLATFORM}")
|
|
|
|
endif()
|
|
|
|
|
2013-03-26 17:00:09 -05:00
|
|
|
# override system install prefix if private installation chosen
|
2013-08-30 08:37:29 -05:00
|
|
|
option (RESINSIGHT_PRIVATE_INSTALL "Install as an independent bundle including the neccesary Qt libraries" ON)
|
|
|
|
if (RESINSIGHT_PRIVATE_INSTALL)
|
2013-04-19 01:54:38 -05:00
|
|
|
set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install/)
|
|
|
|
#set (CMAKE_INSTALL_PREFIX /usr/${RESINSIGHT_FINAL_NAME})
|
2013-08-30 08:37:29 -05:00
|
|
|
endif (RESINSIGHT_PRIVATE_INSTALL)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Application
|
|
|
|
################################################################################
|
|
|
|
add_subdirectory(ApplicationCode)
|
2012-10-04 05:12:58 -05:00
|
|
|
add_subdirectory(OctavePlugin)
|
2012-09-20 08:15:43 -05:00
|
|
|
|
2013-04-19 01:54:38 -05:00
|
|
|
################################################################################
|
|
|
|
# Code documentation using Doxygen
|
|
|
|
################################################################################
|
|
|
|
option(RESINSIGHT_BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
|
|
|
|
if(RESINSIGHT_BUILD_DOCUMENTATION)
|
|
|
|
FIND_PACKAGE(Doxygen)
|
|
|
|
if (NOT DOXYGEN_FOUND)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"Doxygen is needed to build the documentation. Please install it correctly")
|
|
|
|
endif()
|
|
|
|
#-- 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 ALL
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
|
|
|
|
SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
|
|
|
|
# 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.
|
|
|
|
endif(RESINSIGHT_BUILD_DOCUMENTATION)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Installation packaging
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(CPACK_GENERATOR TGZ)
|
|
|
|
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
|
|
|
set(CPACK_GENERATOR ZIP)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MAJOR_VERSION})
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MINOR_VERSION})
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_PATCH_VERSION})
|
|
|
|
|
|
|
|
set(CPACK_PACKAGE_NAME "ResInsight-bin")
|
|
|
|
|
2012-09-11 08:10:28 -05:00
|
|
|
if (NOT "${RESINSIGHT_PLATFORM}" STREQUAL "")
|
|
|
|
set (CPACK_SYSTEM_NAME "${RESINSIGHT_PLATFORM}")
|
|
|
|
endif()
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
include (CPack)
|