CMakeLists.txt 1.77 KB
Newer Older
David Thompson's avatar
David Thompson committed
1 2
cmake_minimum_required(VERSION 3.9.0)

3 4 5 6
if (POLICY CMP0048)
  cmake_policy(SET CMP0048 NEW)
endif()

David Thompson's avatar
David Thompson committed
7 8 9 10 11 12 13 14
#If the user/superbuild hasn't explicitly stated what c++ standard to use
#require C++11
if(NOT DEFINED CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_STANDARD_REQUIRED True)
  set(CMAKE_CXX_EXTENSIONS FALSE)
endif()

15 16
################################################################################
# CMB version number
17
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMBVersion.cmake)
18 19

project(cmb VERSION ${cmb_version})
David Thompson's avatar
David Thompson committed
20 21
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

22 23 24
find_package(ParaView COMPONENTS vtkIOGDAL REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)

25 26 27 28
include(CMBPreamble) # Determine architecture, set up build-output directories.
include(CMBTesting) # Add an option to enable testing and set up pointers to the test data.
include(CMBInstallRules) # Fetch CMB version from version.txt and set up install/output directories.
include(CMBCoverage) # Add options for performing code coverage tests.
David Thompson's avatar
David Thompson committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

# Do not report some warnings from generated code to the dashboard:
configure_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake")

set(cmb_plugin_paths
  "${cmb_plugin_paths}"
  "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
  CACHE STRING "Semi-colon separated paths for testing plugins."
)
mark_as_advanced(cmb_plugin_paths)

add_subdirectory(thirdparty)
add_subdirectory(plugins) # Plugins must be built before the app so .plugins file will be correct.
add_subdirectory(modelbuilder)

option(cmb_enable_documentation "Include targets Sphinx-generated documentation" OFF)
if (cmb_enable_documentation)
  find_package(Sphinx)
  add_subdirectory(doc)
endif()
51 52 53

# Add rules to build packages
include(CMBPackaging)