forked from BlueBrain/Brayns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
217 lines (184 loc) · 6.88 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Copyright (c) 2015-2019, EPFL/Blue Brain Project
# All rights reserved. Do not distribute without permission.
# Responsible Author: Cyrille Favreau <[email protected]>
# Grigori Chevtchenko <[email protected]>
#
# This file is part of Brayns <https://github.com/BlueBrain/Brayns>
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Brayns VERSION 1.0.0)
set(Brayns_VERSION_ABI 1)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/common)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/CMake/common/Common.cmake)
message(FATAL_ERROR "CMake/common missing, run: git submodule update --init")
endif()
set(BRAYNS_LICENSE LGPL)
set(BRAYNS_DESCRIPTION "Hardware Agnostic Ray-Tracer")
set(BRAYNS_MAINTAINER_NAME "Blue Brain Project")
set(BRAYNS_MAINTAINER_EMAIL "<[email protected]>")
set(BRAYNS_MAINTAINER "${BRAYNS_MAINTAINER_NAME} ${BRAYNS_MAINTAINER_EMAIL}")
set(BRAYNS_PORT_DEPEND "assimp boost freeimage glew tbb")
# Unit testing
option(BRAYNS_UNIT_TESTING_ENABLED "Unit testing" ON)
# JSON message live debugging
option(BRAYNS_DEBUG_JSON_ENABLED "Catch JSON exceptions during runtime" OFF)
if(BRAYNS_DEBUG_JSON_ENABLED)
add_definitions(-DBRAYNS_DEBUG_JSON_ENABLED)
endif(BRAYNS_DEBUG_JSON_ENABLED)
# Enable cloning of all optional subprojects for CI builds
if($ENV{TRAVIS})
if(NOT DEFINED BRAYNS_NETWORKING_ENABLED)
option(BRAYNS_NETWORKING_ENABLED "Activate networking interfaces" ON)
endif()
if(NOT DEFINED BRAYNS_DEFLECT_ENABLED)
option(BRAYNS_DEFLECT_ENABLED "Activate streaming to display wall" OFF)
endif()
if(NOT DEFINED BRAYNS_CIRCUITVIEWER_ENABLED)
option(BRAYNS_CIRCUITVIEWER_ENABLED "Activate CircuitViewer plugin" OFF)
endif()
if(NOT DEFINED BRAYNS_CIRCUITEXPLORER_ENABLED)
option(BRAYNS_CIRCUITEXPLORER_ENABLED "Activate CircuitExplorer plugin" ON)
endif()
if(NOT DEFINED BRAYNS_DTI_ENABLED)
option(BRAYNS_DTI_ENABLED "Activate DTI plugin" ON)
endif()
if(NOT DEFINED BRAYNS_BBIC_ENABLED)
option(BRAYNS_BBIC_ENABLED "Activate BBIC Volume plugin" OFF)
endif()
endif()
set(CHOOSE_PYTHON_IGNORE_BOOST ON)
include(Common)
# Compiler options
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function -Wno-class-memaccess -Wno-ignored-qualifiers")
endif()
if ((CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif()
# Core dependencies
common_find_package(Boost REQUIRED COMPONENTS program_options)
common_find_package(OpenMP)
common_find_package(libuv 1.8)
common_find_package(FreeImage)
# Archive loading
common_find_package(LibArchive)
option(BRAYNS_LIBARCHIVE_ENABLED "Activate libarchive for archive loading" ${LibArchive_FOUND})
if(BRAYNS_LIBARCHIVE_ENABLED)
common_find_package(LibArchive REQUIRED)
else()
common_find_package_disable(LibArchive)
endif()
# HTTP messaging
common_find_package(LibJpegTurbo)
common_find_package(Rockets)
common_find_package(FFMPEG 3.4 SYSTEM)
if(ROCKETS_FOUND AND ROCKETS_USE_LIBWEBSOCKETS)
option(BRAYNS_NETWORKING_ENABLED "Activate networking interfaces" ON)
else()
option(BRAYNS_NETWORKING_ENABLED "Activate networking interfaces" OFF)
endif()
if(BRAYNS_NETWORKING_ENABLED)
# We require turbojpeg for networking to get image streaming working
common_find_package(LibJpegTurbo REQUIRED)
common_find_package(Rockets REQUIRED)
if(NOT ROCKETS_USE_LIBWEBSOCKETS)
message(WARNING "Could not enable networking, missing Rockets with libwebsockets")
endif()
list(APPEND COMMON_FIND_PACKAGE_DEFINES BRAYNS_USE_NETWORKING)
else()
common_find_package_disable(LibJpegTurbo)
common_find_package_disable(Rockets)
endif()
# OSPRay rendering engine
common_find_package(ospray 1.8 SYSTEM)
option(BRAYNS_OSPRAY_ENABLED "Activate OSPRay rendering engine" ${OSPRAY_FOUND})
if(BRAYNS_OSPRAY_ENABLED)
common_find_package(ospray 1.8 SYSTEM REQUIRED)
else()
common_find_package_disable(ospray)
endif()
option(BRAYNS_OPTIX_ENABLED "Activate OptiX rendering engine" OFF)
option(BRAYNS_OPTIX_TESTS_ENABLED "Activate OptiX tests" OFF)
if(BRAYNS_OPTIX_ENABLED)
add_subdirectory(engines/optix)
endif()
# Mesh loading
common_find_package(assimp SYSTEM)
option(BRAYNS_ASSIMP_ENABLED "Activate assimp library for standard 3D file format management" ${assimp_FOUND})
if(BRAYNS_ASSIMP_ENABLED)
common_find_package(assimp SYSTEM REQUIRED)
else()
common_find_package_disable(assimp)
endif()
# Brayns viewer application
common_find_package(GLEW SYSTEM)
common_find_package(OpenGL)
if(GLEW_FOUND AND OPENGL_FOUND)
option(BRAYNS_VIEWER_ENABLED "Activate Brayns Viewer" ON)
else()
option(BRAYNS_VIEWER_ENABLED "Activate Brayns Viewer" OFF)
endif()
if(GLEW_FOUND AND OPENGL_FOUND AND FreeImage_FOUND)
option(BRAYNS_IBL_ENABLED "Activate Brayns IBL tool" ON)
else()
option(BRAYNS_IBL_ENABLED "Activate Brayns IBL tool" OFF)
endif()
if(BRAYNS_VIEWER_ENABLED OR BRAYNS_IBL_ENABLED)
common_find_package(GLEW SYSTEM REQUIRED)
common_find_package(OpenGL REQUIRED)
if(BRAYNS_IBL_ENABLED)
common_find_package(FreeImage REQUIRED)
endif()
else()
common_find_package_disable(GLEW)
common_find_package_disable(OpenGL)
endif()
common_find_package_post()
list(APPEND BRAYNS_DEPENDENT_LIBRARIES Async++ glm)
add_subdirectory(deps)
if(libuv_FOUND)
# The libuv version of Ubuntu 16.04 is too old to have this definition that is
# required by uvw (in fact, it uses an old enough version as well to make
# things work, but couldn't go further).
if(libuv_VERSION VERSION_LESS 1.9.0)
add_definitions(-DUV_DISCONNECT=4)
endif()
include_directories(SYSTEM deps/uvw/src)
endif()
# ------------------------------------------------------------------------------
# BRAYNS applications and libraries
# ------------------------------------------------------------------------------
if(BRAYNS_VIEWER_ENABLED)
add_subdirectory(apps/ui)
add_subdirectory(apps/BraynsViewer)
endif()
if(BRAYNS_IBL_ENABLED)
add_subdirectory(apps/BraynsIBL)
endif()
if(libuv_FOUND)
option(BRAYNS_SERVICE_ENABLED "Brayns Service" ON)
if(BRAYNS_SERVICE_ENABLED)
add_subdirectory(apps/BraynsService)
endif()
else()
set(BRAYNS_SERVICE_ENABLED OFF)
endif()
option(BRAYNS_BENCHMARK_ENABLED "Brayns Benchmark" ON)
if(BRAYNS_BENCHMARK_ENABLED)
add_subdirectory(apps/BraynsBenchmark)
endif()
if(BRAYNS_OSPRAY_ENABLED)
add_subdirectory(engines/ospray)
else()
message(WARNING "OSPRay not found or enabled. Brayns cannot work without an engine" )
endif()
add_subdirectory(plugins)
add_subdirectory(brayns)
if(BRAYNS_UNIT_TESTING_ENABLED)
add_subdirectory(tests)
endif()
include(CommonCPack)
set(DOXYGEN_MAINPAGE_MD README.md)
set(DOXYGEN_EXTRA_INPUT "${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/Changelog.md")
set(COMMON_PROJECT_DOMAIN ch.epfl.bluebrain)
include(DoxygenRule)