-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
executable file
·160 lines (137 loc) · 4.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
####################################################################################################
# Copyright (c) 2016 - 2021
# Blue Brain Project (BBP) / Ecole Polytechnique Federale de Lausanne (EPFL)
#
# Author(s)
# Marwan Abdellah <[email protected]>
#
# For complete list of authors, please see AUTHORS.md
#
# This file is part of Ultraliser <https://github.com/BlueBrain/Ultraliser>
#
# This library is free software; you can redistribute it and/or modify it under the terms of the
# GNU Lesser General Public License version 3.0 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along with this library;
# if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
# You can also find it on the GNU web site < https://www.gnu.org/licenses/gpl-3.0.en.html >
####################################################################################################
# CMake 3.5 is required
cmake_minimum_required(VERSION 3.5)
# Ultraliser
project(Ultraliser)
# gcc 8.4 is required
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.4)
message(FATAL_ERROR "GCC version must be at least 9.4")
endif()
endif()
#Add CMake customized modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(OpenMP)
include(TIFF)
include(HDF5)
include(Eigen3)
include(GLM)
include(FMT)
include(ZLIB)
include(BZip2)
# By default add the /usr/include into the path
include_directories("/usr/include")
# C++ 17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Installation directories
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# C++ Flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 \
-Wno-variadic-macros \
-Wno-int-to-pointer-cast \
-Wno-deprecated \
-Wno-unreachable-code \
-Wno-old-style-cast \
-Wno-error=format-security \
-Wno-float-equal")
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DULTRALISER_RELEASE")
OPTION(ENABLE_PROGRESS_BAR "Disable the progress bar to gain performance" ON)
if(ENABLE_PROGRESS_BAR)
add_definitions(-DENABLE_PROGRESS_BAR)
endif()
# Dependencies
message("")
message("*****************************************************************************************")
message("* Dependencies Verification")
if(ULTRALISER_USE_OPENMP)
message(" * OpenMP OK")
else(ULTRALISER_USE_OPENMP)
message(" * OpenMP NOT AVAILABLE!")
endif(ULTRALISER_USE_OPENMP)
if(ULTRALISER_USE_H5)
message(" * HDF5 OK")
else(ULTRALISER_USE_H5)
message(" * HDF5 NOT INSTALLED!")
endif(ULTRALISER_USE_H5)
if(ULTRALISER_USE_TIFF)
message(" * TIFF OK")
else(ULTRALISER_USE_TIFF)
message(" * TIFF NOT INSTALLED!")
endif(ULTRALISER_USE_TIFF)
if(ULTRALISER_USE_EIGEN3)
message(" * EIGEN3 OK")
else(ULTRALISER_USE_EIGEN3)
message(" * EIGEN3 NOT INSTALLED!")
endif(ULTRALISER_USE_EIGEN3)
if(ULTRALISER_USE_ZLIB)
message(" * ZLIB OK")
else(ULTRALISER_USE_ZLIB)
message(" * ZLIB NOT INSTALLED!")
endif(ULTRALISER_USE_ZLIB)
if(ULTRALISER_USE_BZIP2)
message(" * BZIP2 OK")
else(ULTRALISER_USE_BZIP2)
message(" * BZIP2 NOT INSTALLED!")
endif(ULTRALISER_USE_BZIP2)
if(ULTRALISER_USE_GLM)
message(" * GLM OK")
else(ULTRALISER_USE_GLM)
message(" * GLM NOT INSTALLED!")
endif(ULTRALISER_USE_GLM)
if(ULTRALISER_USE_FMT)
message(" * FMT OK")
else(ULTRALISER_USE_FMT)
message(" * FMT NOT INSTALLED!")
endif(ULTRALISER_USE_FMT)
if(ULTRALISER_USE_ZLIB AND
ULTRALISER_USE_BZIP2 AND
ULTRALISER_USE_GLM AND
ULTRALISER_USE_FMT)
message(" * NRRD Deps. OK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DULTRALISER_USE_NRRD")
set(ULTRALISER_USE_NRRD TRUE)
else(ULTRALISER_USE_ZLIB AND
ULTRALISER_USE_BZIP2 AND
ULTRALISER_USE_GLM AND
ULTRALISER_USE_FMT)
message(" * NRRD Deps. NOT AVAILABLE! nrrdLoader will NOT be compiled.")
set(ULTRALISER_USE_NRRD FALSE)
endif(ULTRALISER_USE_ZLIB AND
ULTRALISER_USE_BZIP2 AND
ULTRALISER_USE_GLM AND
ULTRALISER_USE_FMT)
message("*****************************************************************************************")
message("")
# Extenral libraries, mainly the NRRD library, from Brayns
add_subdirectory(externals)
# Ultraliser library
add_subdirectory(ultraliser)
# Ultraliser applications
add_subdirectory(apps)