Mercurial > hg > orthanc
comparison Resources/CMake/OrthancFrameworkConfiguration.cmake @ 2429:fe90b3ec9d4a
improvement in Orthanc framework config
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 27 Oct 2017 13:04:41 +0200 |
parents | 5edec967055e |
children | d9e3781d2023 |
comparison
equal
deleted
inserted
replaced
2428:dedc24644cbe | 2429:fe90b3ec9d4a |
---|---|
22 include(FindPythonInterp) | 22 include(FindPythonInterp) |
23 | 23 |
24 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) | 24 include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) |
25 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) | 25 include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) |
26 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) | 26 include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) |
27 | |
28 | |
29 ##################################################################### | |
30 ## Disable unneeded macros | |
31 ##################################################################### | |
32 | |
33 if (NOT ENABLE_SQLITE) | |
34 unset(USE_SYSTEM_SQLITE CACHE) | |
35 add_definitions(-DORTHANC_ENABLE_SQLITE=0) | |
36 endif() | |
37 | |
38 if (NOT ENABLE_CRYPTO_OPTIONS) | |
39 unset(ENABLE_SSL CACHE) | |
40 unset(ENABLE_PKCS11 CACHE) | |
41 unset(USE_SYSTEM_OPENSSL CACHE) | |
42 unset(USE_SYSTEM_LIBP11 CACHE) | |
43 add_definitions( | |
44 -DORTHANC_ENABLE_SSL=0 | |
45 -DORTHANC_ENABLE_PKCS11=0 | |
46 ) | |
47 endif() | |
48 | |
49 if (NOT ENABLE_WEB_CLIENT) | |
50 unset(USE_SYSTEM_CURL CACHE) | |
51 add_definitions(-DORTHANC_ENABLE_CURL=0) | |
52 endif() | |
53 | |
54 if (NOT ENABLE_WEB_SERVER) | |
55 unset(ENABLE_CIVETWEB CACHE) | |
56 unset(USE_SYSTEM_CIVETWEB CACHE) | |
57 unset(USE_SYSTEM_MONGOOSE CACHE) | |
58 add_definitions( | |
59 -DORTHANC_ENABLE_CIVETWEB=0 | |
60 -DORTHANC_ENABLE_MONGOOSE=0 | |
61 ) | |
62 endif() | |
63 | |
64 if (NOT ENABLE_JPEG) | |
65 unset(USE_SYSTEM_LIBJPEG CACHE) | |
66 add_definitions(-DORTHANC_ENABLE_JPEG=0) | |
67 endif() | |
68 | |
69 if (NOT ENABLE_PNG) | |
70 unset(USE_SYSTEM_LIBPNG CACHE) | |
71 add_definitions(-DORTHANC_ENABLE_PNG=0) | |
72 endif() | |
73 | |
74 if (NOT ENABLE_LUA) | |
75 unset(USE_SYSTEM_LUA CACHE) | |
76 add_definitions(-DORTHANC_ENABLE_LUA=0) | |
77 endif() | |
78 | |
79 if (NOT ENABLE_PUGIXML) | |
80 unset(USE_SYSTEM_PUGIXML CACHE) | |
81 add_definitions(-DORTHANC_ENABLE_PUGIXML=0) | |
82 endif() | |
83 | |
84 if (NOT ENABLE_LOCALE) | |
85 unset(USE_SYSTEM_LIBICONV CACHE) | |
86 add_definitions(-DORTHANC_ENABLE_LOCALE=0) | |
87 endif() | |
88 | |
89 if (NOT ENABLE_GOOGLE_TEST) | |
90 unset(USE_SYSTEM_GOOGLE_TEST CACHE) | |
91 unset(USE_GOOGLE_TEST_DEBIAN_PACKAGE CACHE) | |
92 endif() | |
93 | |
94 if (NOT ENABLE_DCMTK) | |
95 add_definitions( | |
96 -DORTHANC_ENABLE_DCMTK=0 | |
97 -DORTHANC_ENABLE_DCMTK_NETWORKING=0 | |
98 ) | |
99 unset(DCMTK_DICTIONARY_DIR CACHE) | |
100 unset(USE_DCMTK_360 CACHE) | |
101 unset(USE_DCMTK_362_PRIVATE_DIC CACHE) | |
102 unset(USE_SYSTEM_DCMTK CACHE) | |
103 unset(ENABLE_DCMTK_JPEG CACHE) | |
104 unset(ENABLE_DCMTK_JPEG_LOSSLESS CACHE) | |
105 endif() | |
27 | 106 |
28 | 107 |
29 ##################################################################### | 108 ##################################################################### |
30 ## List of source files | 109 ## List of source files |
31 ##################################################################### | 110 ##################################################################### |
78 ${ORTHANC_ROOT}/Core/SQLite/Statement.cpp | 157 ${ORTHANC_ROOT}/Core/SQLite/Statement.cpp |
79 ${ORTHANC_ROOT}/Core/SQLite/StatementId.cpp | 158 ${ORTHANC_ROOT}/Core/SQLite/StatementId.cpp |
80 ${ORTHANC_ROOT}/Core/SQLite/StatementReference.cpp | 159 ${ORTHANC_ROOT}/Core/SQLite/StatementReference.cpp |
81 ${ORTHANC_ROOT}/Core/SQLite/Transaction.cpp | 160 ${ORTHANC_ROOT}/Core/SQLite/Transaction.cpp |
82 ) | 161 ) |
83 else() | |
84 unset(USE_SYSTEM_SQLITE CACHE) | |
85 add_definitions(-DORTHANC_ENABLE_SQLITE=0) | |
86 endif() | 162 endif() |
87 | 163 |
88 | 164 |
89 ## | 165 ## |
90 ## Cryptography: OpenSSL and libp11 | 166 ## Cryptography: OpenSSL and libp11 |
112 message(FATAL_ERROR "OpenSSL is required to enable PKCS#11 support") | 188 message(FATAL_ERROR "OpenSSL is required to enable PKCS#11 support") |
113 endif() | 189 endif() |
114 else() | 190 else() |
115 add_definitions(-DORTHANC_ENABLE_PKCS11=0) | 191 add_definitions(-DORTHANC_ENABLE_PKCS11=0) |
116 endif() | 192 endif() |
117 | |
118 else() # ENABLE_CRYPTO_OPTIONS == OFF | |
119 unset(ENABLE_SSL CACHE) | |
120 unset(ENABLE_PKCS11 CACHE) | |
121 unset(USE_SYSTEM_OPENSSL CACHE) | |
122 unset(USE_SYSTEM_LIBP11 CACHE) | |
123 add_definitions( | |
124 -DORTHANC_ENABLE_SSL=0 | |
125 -DORTHANC_ENABLE_PKCS11=0 | |
126 ) | |
127 endif() | 193 endif() |
128 | 194 |
129 | 195 |
130 ## | 196 ## |
131 ## HTTP client: libcurl | 197 ## HTTP client: libcurl |
136 add_definitions(-DORTHANC_ENABLE_CURL=1) | 202 add_definitions(-DORTHANC_ENABLE_CURL=1) |
137 | 203 |
138 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL | 204 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL |
139 ${ORTHANC_ROOT}/Core/HttpClient.cpp | 205 ${ORTHANC_ROOT}/Core/HttpClient.cpp |
140 ) | 206 ) |
141 else() | |
142 unset(USE_SYSTEM_CURL CACHE) | |
143 add_definitions(-DORTHANC_ENABLE_CURL=0) | |
144 endif() | 207 endif() |
145 | 208 |
146 | 209 |
147 ## | 210 ## |
148 ## HTTP server: Mongoose 3.8 or Civetweb | 211 ## HTTP server: Mongoose 3.8 or Civetweb |
179 ${ORTHANC_ROOT}/Core/RestApi/RestApiGetCall.cpp | 242 ${ORTHANC_ROOT}/Core/RestApi/RestApiGetCall.cpp |
180 ${ORTHANC_ROOT}/Core/RestApi/RestApiHierarchy.cpp | 243 ${ORTHANC_ROOT}/Core/RestApi/RestApiHierarchy.cpp |
181 ${ORTHANC_ROOT}/Core/RestApi/RestApiOutput.cpp | 244 ${ORTHANC_ROOT}/Core/RestApi/RestApiOutput.cpp |
182 ${ORTHANC_ROOT}/Core/RestApi/RestApiPath.cpp | 245 ${ORTHANC_ROOT}/Core/RestApi/RestApiPath.cpp |
183 ) | 246 ) |
184 | |
185 else() | |
186 unset(ENABLE_CIVETWEB CACHE) | |
187 unset(USE_SYSTEM_CIVETWEB CACHE) | |
188 unset(USE_SYSTEM_MONGOOSE CACHE) | |
189 add_definitions( | |
190 -DORTHANC_ENABLE_CIVETWEB=0 | |
191 -DORTHANC_ENABLE_MONGOOSE=0 | |
192 ) | |
193 endif() | 247 endif() |
194 | 248 |
195 | 249 |
196 ## | 250 ## |
197 ## JPEG support: libjpeg | 251 ## JPEG support: libjpeg |
204 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL | 258 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL |
205 ${ORTHANC_ROOT}/Core/Images/JpegErrorManager.cpp | 259 ${ORTHANC_ROOT}/Core/Images/JpegErrorManager.cpp |
206 ${ORTHANC_ROOT}/Core/Images/JpegReader.cpp | 260 ${ORTHANC_ROOT}/Core/Images/JpegReader.cpp |
207 ${ORTHANC_ROOT}/Core/Images/JpegWriter.cpp | 261 ${ORTHANC_ROOT}/Core/Images/JpegWriter.cpp |
208 ) | 262 ) |
209 | |
210 else() | |
211 unset(USE_SYSTEM_LIBJPEG CACHE) | |
212 add_definitions(-DORTHANC_ENABLE_JPEG=0) | |
213 endif() | 263 endif() |
214 | 264 |
215 | 265 |
216 ## | 266 ## |
217 ## PNG support: libpng (in conjunction with zlib) | 267 ## PNG support: libpng (in conjunction with zlib) |
223 | 273 |
224 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL | 274 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL |
225 ${ORTHANC_ROOT}/Core/Images/PngReader.cpp | 275 ${ORTHANC_ROOT}/Core/Images/PngReader.cpp |
226 ${ORTHANC_ROOT}/Core/Images/PngWriter.cpp | 276 ${ORTHANC_ROOT}/Core/Images/PngWriter.cpp |
227 ) | 277 ) |
228 | |
229 else() | |
230 unset(USE_SYSTEM_LIBPNG CACHE) | |
231 add_definitions(-DORTHANC_ENABLE_PNG=0) | |
232 endif() | 278 endif() |
233 | 279 |
234 | 280 |
235 ## | 281 ## |
236 ## Lua support | 282 ## Lua support |
242 | 288 |
243 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL | 289 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL |
244 ${ORTHANC_ROOT}/Core/Lua/LuaContext.cpp | 290 ${ORTHANC_ROOT}/Core/Lua/LuaContext.cpp |
245 ${ORTHANC_ROOT}/Core/Lua/LuaFunctionCall.cpp | 291 ${ORTHANC_ROOT}/Core/Lua/LuaFunctionCall.cpp |
246 ) | 292 ) |
247 else() | |
248 unset(USE_SYSTEM_LUA CACHE) | |
249 add_definitions(-DORTHANC_ENABLE_LUA=0) | |
250 endif() | 293 endif() |
251 | 294 |
252 | 295 |
253 ## | 296 ## |
254 ## XML support: pugixml | 297 ## XML support: pugixml |
255 ## | 298 ## |
256 | 299 |
257 if (ENABLE_PUGIXML) | 300 if (ENABLE_PUGIXML) |
258 include(${CMAKE_CURRENT_LIST_DIR}/PugixmlConfiguration.cmake) | 301 include(${CMAKE_CURRENT_LIST_DIR}/PugixmlConfiguration.cmake) |
259 add_definitions(-DORTHANC_ENABLE_PUGIXML=1) | 302 add_definitions(-DORTHANC_ENABLE_PUGIXML=1) |
260 else() | |
261 unset(USE_SYSTEM_PUGIXML CACHE) | |
262 add_definitions(-DORTHANC_ENABLE_PUGIXML=0) | |
263 endif() | 303 endif() |
264 | 304 |
265 | 305 |
266 ## | 306 ## |
267 ## Locale support: libiconv | 307 ## Locale support: libiconv |
268 ## | 308 ## |
269 | 309 |
270 if (ENABLE_LOCALE) | 310 if (ENABLE_LOCALE) |
271 include(${CMAKE_CURRENT_LIST_DIR}/LibIconvConfiguration.cmake) | 311 include(${CMAKE_CURRENT_LIST_DIR}/LibIconvConfiguration.cmake) |
272 add_definitions(-DORTHANC_ENABLE_LOCALE=1) | 312 add_definitions(-DORTHANC_ENABLE_LOCALE=1) |
273 else() | |
274 unset(USE_SYSTEM_LIBICONV CACHE) | |
275 add_definitions(-DORTHANC_ENABLE_LOCALE=0) | |
276 endif() | 313 endif() |
277 | 314 |
278 | 315 |
279 ## | 316 ## |
280 ## Google Test for unit testing | 317 ## Google Test for unit testing |
281 ## | 318 ## |
282 | 319 |
283 if (ENABLE_GOOGLE_TEST) | 320 if (ENABLE_GOOGLE_TEST) |
284 include(${CMAKE_CURRENT_LIST_DIR}/GoogleTestConfiguration.cmake) | 321 include(${CMAKE_CURRENT_LIST_DIR}/GoogleTestConfiguration.cmake) |
285 else() | |
286 unset(USE_SYSTEM_GOOGLE_TEST CACHE) | |
287 unset(USE_GOOGLE_TEST_DEBIAN_PACKAGE CACHE) | |
288 endif() | 322 endif() |
289 | 323 |
290 | 324 |
291 | 325 |
292 ##################################################################### | 326 ##################################################################### |
362 ) | 396 ) |
363 list(APPEND ORTHANC_DICOM_SOURCES_DEPENDENCIES | 397 list(APPEND ORTHANC_DICOM_SOURCES_DEPENDENCIES |
364 ${AUTOGENERATED_SOURCES} | 398 ${AUTOGENERATED_SOURCES} |
365 ) | 399 ) |
366 endif() | 400 endif() |
367 | |
368 else() | |
369 add_definitions( | |
370 -DORTHANC_ENABLE_DCMTK=0 | |
371 -DORTHANC_ENABLE_DCMTK_NETWORKING=0 | |
372 ) | |
373 unset(DCMTK_DICTIONARY_DIR CACHE) | |
374 unset(USE_DCMTK_360 CACHE) | |
375 unset(USE_DCMTK_362_PRIVATE_DIC CACHE) | |
376 unset(USE_SYSTEM_DCMTK CACHE) | |
377 unset(ENABLE_DCMTK_JPEG CACHE) | |
378 unset(ENABLE_DCMTK_JPEG_LOSSLESS CACHE) | |
379 endif() | 401 endif() |
380 | 402 |
381 | 403 |
382 ##################################################################### | 404 ##################################################################### |
383 ## Configuration of the C/C++ macros | 405 ## Configuration of the C/C++ macros |