forked from educelab/volume-cartographer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
113 lines (90 loc) · 3.11 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
cmake_minimum_required(VERSION 3.24..3.27 FATAL_ERROR)
include(FetchContent)
include(CMakeDependentOption)
set(VC_VERSION 2.25.0)
option(VC_VERSION_DATESTAMP "Append date stamp to version number" off)
if(VC_VERSION_DATESTAMP)
string(TIMESTAMP VC_VERSION_TWEAK "%s")
set(VC_VERSION ${VC_VERSION}.${VC_VERSION_TWEAK})
endif()
project(VC VERSION ${VC_VERSION})
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# Use modern C++ for everything and generate compile_commands database.
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
# Choose what to build
option(VC_BUILD_APPS "Compile VC core programs" on)
option(VC_BUILD_GUI "Compile GUI programs" on)
option(VC_BUILD_UTILS "Compile VC utility programs" on)
option(VC_BUILD_EXAMPLES "Compile VC example programs" off)
option(VC_BUILD_TESTS "Compile VC test programs" off)
option(VC_BUILD_PYTHON_BINDINGS "Build Python bindings." off)
# Choose what to install
option(VC_INSTALL_APPS "Install VC core programs" on)
option(VC_INSTALL_LIBS "Install VC libraries" on)
option(VC_INSTALL_UTILS "Install VC utility programs" on)
option(VC_INSTALL_PYTHON_BINDINGS "Install Python bindings." off)
# Some helpful constants to be used in subprojects.
include(VCConstants)
# Look for external dependencies.
include(VCFindDependencies)
# XXX Hack to get ninja output colorized for all source files.
if (CMAKE_GENERATOR MATCHES "Ninja")
add_compile_options(-fdiagnostics-color=always)
endif()
# Weird bug on macOS where system includes aren't included with the right flag
if (APPLE)
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
endif()
if (VC_BUILD_TESTS)
enable_testing()
endif()
## VC Libraries ##
option(VC_DEVELOPER_WARNINGS "For developers: Enable extensive compiler warnings" OFF)
mark_as_advanced(VC_DEVELOPER_WARNINGS)
if(VC_DEVELOPER_WARNINGS)
include(VCWarnings)
endif()
add_subdirectory(core)
if (VC_BUILD_TESTS)
add_subdirectory(testing)
endif()
add_subdirectory(meshing)
add_subdirectory(segmentation)
add_subdirectory(texturing)
add_subdirectory(graph)
# App support library
if(VC_BUILD_APPS OR VC_BUILD_UTILS)
add_subdirectory(app_support)
endif()
## VC Core Apps ##
if (VC_BUILD_APPS)
add_subdirectory(apps)
endif()
## VC Utility apps ##
if (VC_BUILD_UTILS)
add_subdirectory(utils)
endif()
## VC Example Apps ##
if (VC_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
## VC Documentation
find_package(Doxygen OPTIONAL_COMPONENTS dot)
CMAKE_DEPENDENT_OPTION(VC_BUILD_DOCS "Build VC Doxygen documentation" on "DOXYGEN_FOUND" off)
CMAKE_DEPENDENT_OPTION(VC_INSTALL_DOCS "Install VC documentation" off "VC_BUILD_DOCS" off)
if(VC_BUILD_DOCS)
add_subdirectory(docs)
endif()
if(VC_BUILD_PYTHON_BINDINGS)
add_subdirectory(python)
endif()
# Setup the config files #
include(VCPackageConfig)
# Install to system directories
include(VCInstall)
# Look for the SDL2 package for Audio
find_package(SDL2 REQUIRED)
# Look for the GNU Scientific Library (GSL) package for interpolation related functionalities
find_package(GSL REQUIRED)