2012-05-18 09:45:23 +02:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
|
|
2014-08-12 15:02:19 +02:00
|
|
|
include (CheckCSourceCompiles)
|
2012-05-18 09:45:23 +02:00
|
|
|
project (ResInsight)
|
|
|
|
|
|
2013-09-20 16:21:46 +02:00
|
|
|
set (VIZ_MODULES_FOLDER_NAME Fwk/VizFwk)
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-04-29 10:50:25 +02:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-04-12 15:27:18 +02:00
|
|
|
|
2013-10-07 07:23:04 +02:00
|
|
|
################################################################################
|
2012-05-18 09:45:23 +02:00
|
|
|
# Setup the main platform defines
|
2013-10-07 07:23:04 +02:00
|
|
|
################################################################################
|
2012-05-18 09:45:23 +02: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 07:23:04 +02:00
|
|
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2016-05-24 10:28:04 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat -std=gnu++11")
|
2013-10-07 07:23:04 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG")
|
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG")
|
|
|
|
|
endif()
|
|
|
|
|
|
2013-08-30 15:37:29 +02:00
|
|
|
|
2013-10-07 07:23:04 +02: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 09:45:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
2013-01-22 09:30:28 +01:00
|
|
|
# Version number
|
2012-05-18 09:45:23 +02:00
|
|
|
################################################################################
|
2013-01-22 09:30:28 +01:00
|
|
|
include (ResInsightVersion.cmake)
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2016-05-27 11:25:50 +02:00
|
|
|
################################################################################
|
|
|
|
|
# Boost
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
# if we are building shared libraries ourselves, then don't include Boost in them
|
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
|
elseif (DEFINED BUILD_SHARED_LIBS)
|
|
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
|
|
|
endif ()
|
|
|
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
|
|
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
|
|
|
|
|
2016-05-27 17:28:31 +02:00
|
|
|
if (MSVC)
|
|
|
|
|
ADD_DEFINITIONS("-DBOOST_ALL_NO_LIB")
|
|
|
|
|
endif()
|
2016-05-27 12:48:56 +02:00
|
|
|
|
|
|
|
|
|
2016-05-27 11:25:50 +02:00
|
|
|
# Requires BOOST filesystem version 3, thus 1.44 is necessary.
|
|
|
|
|
add_definitions(-DBOOST_FILESYSTEM_VERSION=3)
|
|
|
|
|
find_package(Boost 1.44.0 COMPONENTS filesystem date_time system regex REQUIRED)
|
|
|
|
|
|
2012-09-11 09:22:36 +02:00
|
|
|
|
2013-01-17 13:33:59 +01:00
|
|
|
################################################################################
|
|
|
|
|
# ERT
|
|
|
|
|
################################################################################
|
2013-04-04 11:27:38 +02:00
|
|
|
|
2016-05-26 21:23:16 +02:00
|
|
|
if (NOT MSVC)
|
|
|
|
|
# Linux: Optional configuration of externally installed ERT, requires path to libraries and includes
|
2016-05-26 21:40:19 +02:00
|
|
|
set(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT "" CACHE PATH "Path to installed ERT libraries")
|
|
|
|
|
set(RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT "" CACHE PATH "Path to installed ERT includes")
|
2016-05-26 21:23:16 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
|
|
|
|
if (NOT(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT AND RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT))
|
|
|
|
|
message(FATAL_ERROR "Both RESINSIGHT_ERT_EXTERNAL_LIB_ROOT and RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT must be defined")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
list(APPEND ERT_INCLUDE_DIRS
|
|
|
|
|
${RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
list(APPEND ERT_LIBRARIES
|
|
|
|
|
${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}/libecl.so
|
|
|
|
|
${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}/libecl_well.so
|
|
|
|
|
${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}/libert_geometry.so
|
|
|
|
|
${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}/libert_util.so
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
else(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
|
|
|
|
|
|
|
|
|
# Disable install of ERT libs and headers, as Ert code is compiled and linked directly
|
|
|
|
|
SET(INSTALL_ERT OFF CACHE BOOL "ERT: Install library")
|
|
|
|
|
SET(BUILD_PYTHON OFF CACHE BOOL "ERT: Run py_compile on the python wrappers")
|
|
|
|
|
SET(BUILD_SHARED_LIBS OFF CACHE BOOL "ERT: Build shared libraries")
|
|
|
|
|
SET(ERT_USE_OPENMP ${OPENMP_FOUND} CACHE BOOL "ERT: Compile using OpenMP")
|
2016-05-27 17:28:31 +02:00
|
|
|
SET(ERT_BUILD_CXX ON CACHE BOOL "ERT: Enable build of CXX wrappers")
|
2016-05-26 21:23:16 +02:00
|
|
|
|
|
|
|
|
if (NOT MSVC)
|
|
|
|
|
SET(RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT "" CACHE STRING "Path to ERT CMakeList.txt (source path)")
|
2016-05-26 14:49:13 +02:00
|
|
|
endif()
|
2016-05-26 21:23:16 +02:00
|
|
|
|
|
|
|
|
if (RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT)
|
|
|
|
|
set(ERT_INCLUDE_ROOT "${RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT}")
|
|
|
|
|
add_subdirectory(${ERT_SOURCE_PATH} ${CMAKE_BINARY_DIR}/ThirdParty/Ert)
|
|
|
|
|
else()
|
|
|
|
|
set(ERT_INCLUDE_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel)
|
|
|
|
|
add_subdirectory(ThirdParty/Ert/devel)
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
list(APPEND ERT_INCLUDE_DIRS
|
|
|
|
|
${ERT_INCLUDE_ROOT}/libecl/include/
|
|
|
|
|
${ERT_INCLUDE_ROOT}/libert_util/include/
|
|
|
|
|
${ERT_INCLUDE_ROOT}/libgeometry/include/
|
|
|
|
|
${ERT_INCLUDE_ROOT}/libecl_well/include/
|
|
|
|
|
${ERT_INCLUDE_ROOT}/libeclxx/include
|
|
|
|
|
${ERT_INCLUDE_ROOT}/libert_utilxx/include
|
|
|
|
|
|
|
|
|
|
${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
list(APPEND ERT_LIBRARIES
|
|
|
|
|
ecl
|
2016-05-27 17:28:31 +02:00
|
|
|
eclxx
|
2016-05-26 21:23:16 +02:00
|
|
|
ecl_well
|
|
|
|
|
ert_geometry
|
|
|
|
|
ert_util
|
|
|
|
|
)
|
|
|
|
|
|
2016-05-27 17:28:31 +02:00
|
|
|
if (MSVC)
|
|
|
|
|
set_property(TARGET
|
|
|
|
|
${ERT_LIBRARIES}
|
|
|
|
|
ecl_lfs
|
|
|
|
|
PROPERTY FOLDER "ERT"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2016-05-26 21:23:16 +02:00
|
|
|
|
|
|
|
|
endif(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
|
|
|
|
|
2013-01-17 21:26:12 +01:00
|
|
|
|
2016-05-27 13:12:31 +02:00
|
|
|
################################################################################
|
|
|
|
|
# Opm
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/custom-opm-common)
|
2016-05-27 16:00:50 +02:00
|
|
|
add_subdirectory(ThirdParty/custom-opm-parser)
|
2016-05-27 13:12:31 +02:00
|
|
|
|
2016-05-27 17:28:31 +02:00
|
|
|
include_directories(${custom-opm-parser_SOURCE_DIR}/opm-parser/)
|
|
|
|
|
add_subdirectory(ThirdParty/custom-opm-parser/opm-parser/opm/json)
|
|
|
|
|
|
|
|
|
|
set_property(TARGET
|
|
|
|
|
custom-opm-common
|
|
|
|
|
custom-opm-parser
|
|
|
|
|
opmjson
|
|
|
|
|
PROPERTY FOLDER "OPM"
|
|
|
|
|
)
|
|
|
|
|
|
2015-09-11 17:03:11 +02:00
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
# NRLib
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/NRLib)
|
|
|
|
|
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
################################################################################
|
|
|
|
|
# Qt
|
|
|
|
|
################################################################################
|
2013-05-16 14:10:22 +02:00
|
|
|
set (QT_COMPONENTS_REQUIRED QtCore QtGui QtMain QtOpenGl QtNetwork QtScript QtScriptTools)
|
2013-10-16 13:51:42 +02:00
|
|
|
find_package (Qt4 COMPONENTS ${QT_COMPONENTS_REQUIRED})
|
2013-10-16 14:16:35 +02:00
|
|
|
if ( NOT QT4_FOUND )
|
2013-10-16 13:51:42 +02:00
|
|
|
message(FATAL_ERROR "Package Qt4 is required, but not found. Please specify qmake for variable QT_QMAKE_EXECUTABLE")
|
2013-10-16 14:16:35 +02:00
|
|
|
endif ( NOT QT4_FOUND )
|
2013-10-16 13:51:42 +02: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 09:45:23 +02:00
|
|
|
include (${QT_USE_FILE})
|
|
|
|
|
|
|
|
|
|
# Open GL
|
|
|
|
|
find_package( OpenGL )
|
|
|
|
|
|
2015-08-26 12:27:29 +02:00
|
|
|
################################################################################
|
|
|
|
|
# Qwt
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
add_subdirectory(ThirdParty/Qwt/src)
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
################################################################################
|
2014-04-11 11:29:31 +02:00
|
|
|
# Vizualization Framework
|
2012-05-18 09:45:23 +02:00
|
|
|
################################################################################
|
2014-04-11 11:29:31 +02:00
|
|
|
|
|
|
|
|
# Allow use of non-threadsafe reference counter in cvf::Object on systems with no atomics support
|
2014-04-15 08:51:18 +02:00
|
|
|
if (CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
|
|
2014-04-15 11:50:04 +02:00
|
|
|
if (NOT DEFINED HAVE_GCC_SYNC_FUNCTIONS)
|
2014-04-15 09:48:32 +02: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 11:50:04 +02:00
|
|
|
__sync_fetch_and_sub(&a, 1); }" HAVE_GCC_SYNC_FUNCTIONS)
|
2014-04-15 09:48:32 +02:00
|
|
|
endif()
|
2014-04-15 08:51:18 +02:00
|
|
|
|
2014-04-15 11:50:04 +02:00
|
|
|
if (HAVE_GCC_SYNC_FUNCTIONS)
|
|
|
|
|
message("GCC synchronization functions detected")
|
2014-04-15 09:48:32 +02:00
|
|
|
else()
|
2014-04-15 11:50:04 +02:00
|
|
|
message("GCC synchronization functions NOT detected, fallback to non threadsafe reference counting")
|
|
|
|
|
add_definitions(-DCVF_USE_NON_THREADSAFE_REFERENCE_COUNT)
|
2014-04-15 08:51:18 +02:00
|
|
|
endif()
|
|
|
|
|
|
2014-04-11 11:29:31 +02:00
|
|
|
endif()
|
|
|
|
|
|
2012-05-18 09:45:23 +02: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}
|
|
|
|
|
)
|
|
|
|
|
|
2016-05-26 14:49:13 +02:00
|
|
|
list(APPEND VIZ_FWK_LIBRARIES
|
|
|
|
|
LibGuiQt
|
|
|
|
|
LibViewing
|
|
|
|
|
LibRender
|
|
|
|
|
LibGeometry
|
|
|
|
|
LibCore
|
|
|
|
|
)
|
|
|
|
|
|
2015-04-29 10:50:25 +02:00
|
|
|
set_property(TARGET
|
2016-05-26 14:49:13 +02:00
|
|
|
${VIZ_FWK_LIBRARIES}
|
|
|
|
|
PROPERTY FOLDER "VizFwk"
|
2015-04-29 10:50:25 +02:00
|
|
|
)
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
################################################################################
|
2014-04-11 11:29:31 +02:00
|
|
|
# Application Framework
|
2012-05-18 09:45:23 +02:00
|
|
|
################################################################################
|
|
|
|
|
|
2013-09-20 16:21:46 +02:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafAnimControl)
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafViewer)
|
2015-07-29 14:20:15 +02: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 16:21:46 +02:00
|
|
|
add_subdirectory(Fwk/AppFwk/cafUserInterface)
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafPdmCvf)
|
2015-07-29 14:20:15 +02:00
|
|
|
add_subdirectory(Fwk/AppFwk/CommonCode)
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-11-26 14:18:11 +01:00
|
|
|
#add_subdirectory(Fwk/AppFwk/cafTests/cafTestCvfApplication)
|
2015-07-29 14:20:15 +02:00
|
|
|
|
|
|
|
|
add_subdirectory(Fwk/AppFwk/cafTensor)
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2016-05-26 14:49:13 +02:00
|
|
|
list(APPEND APP_FWK_LIBRARIES
|
2015-07-29 14:20:15 +02:00
|
|
|
cafPdmCore
|
|
|
|
|
cafPdmUiCore
|
|
|
|
|
cafPdmXml
|
2016-05-26 14:49:13 +02:00
|
|
|
|
|
|
|
|
cafUserInterface
|
|
|
|
|
cafViewer
|
|
|
|
|
cafAnimControl
|
2015-07-29 14:20:15 +02:00
|
|
|
cafCommand
|
2016-05-26 14:49:13 +02:00
|
|
|
cafPdmCvf
|
|
|
|
|
|
2015-06-17 12:55:08 +02:00
|
|
|
cafTensor
|
2016-05-26 14:49:13 +02:00
|
|
|
CommonCode
|
2015-04-29 10:50:25 +02:00
|
|
|
)
|
|
|
|
|
|
2016-05-26 14:49:13 +02:00
|
|
|
set_property(TARGET
|
|
|
|
|
${APP_FWK_LIBRARIES}
|
|
|
|
|
PROPERTY FOLDER "AppFwk"
|
|
|
|
|
)
|
2015-04-29 10:50:25 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
################################################################################
|
|
|
|
|
# Installation settings
|
|
|
|
|
################################################################################
|
2012-09-11 15:10:28 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
set (RESINSIGHT_FINAL_NAME "ResInsight-${STRPRODUCTVER}")
|
2012-09-11 15:10:28 +02: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 23:00:09 +01:00
|
|
|
# override system install prefix if private installation chosen
|
2013-08-30 15:37:29 +02:00
|
|
|
option (RESINSIGHT_PRIVATE_INSTALL "Install as an independent bundle including the neccesary Qt libraries" ON)
|
|
|
|
|
if (RESINSIGHT_PRIVATE_INSTALL)
|
2013-04-19 08:54:38 +02:00
|
|
|
set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install/)
|
|
|
|
|
#set (CMAKE_INSTALL_PREFIX /usr/${RESINSIGHT_FINAL_NAME})
|
2013-08-30 15:37:29 +02:00
|
|
|
endif (RESINSIGHT_PRIVATE_INSTALL)
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
# Application
|
|
|
|
|
################################################################################
|
|
|
|
|
add_subdirectory(ApplicationCode)
|
2012-10-04 12:12:58 +02:00
|
|
|
add_subdirectory(OctavePlugin)
|
2012-09-20 15:15:43 +02:00
|
|
|
|
2013-04-19 08:54:38 +02: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 09:45:23 +02: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 15:10:28 +02:00
|
|
|
if (NOT "${RESINSIGHT_PLATFORM}" STREQUAL "")
|
|
|
|
|
set (CPACK_SYSTEM_NAME "${RESINSIGHT_PLATFORM}")
|
|
|
|
|
endif()
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
include (CPack)
|