comparison Resources/CMake/OrthancFrameworkConfiguration.cmake @ 2508:91ee08d986f9

possibility to disable zlib support in the Orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 28 Mar 2018 11:24:17 +0200
parents 9c54c40eaf25
children 04873915beaf
comparison
equal deleted inserted replaced
2507:99116ed6f38c 2508:91ee08d986f9
69 if (NOT ENABLE_JPEG) 69 if (NOT ENABLE_JPEG)
70 unset(USE_SYSTEM_LIBJPEG CACHE) 70 unset(USE_SYSTEM_LIBJPEG CACHE)
71 add_definitions(-DORTHANC_ENABLE_JPEG=0) 71 add_definitions(-DORTHANC_ENABLE_JPEG=0)
72 endif() 72 endif()
73 73
74 if (NOT ENABLE_ZLIB)
75 unset(USE_SYSTEM_ZLIB CACHE)
76 add_definitions(-DORTHANC_ENABLE_ZLIB=0)
77 endif()
78
74 if (NOT ENABLE_PNG) 79 if (NOT ENABLE_PNG)
75 unset(USE_SYSTEM_LIBPNG CACHE) 80 unset(USE_SYSTEM_LIBPNG CACHE)
76 add_definitions(-DORTHANC_ENABLE_PNG=0) 81 add_definitions(-DORTHANC_ENABLE_PNG=0)
77 endif() 82 endif()
78 83
115 ##################################################################### 120 #####################################################################
116 121
117 set(ORTHANC_CORE_SOURCES_INTERNAL 122 set(ORTHANC_CORE_SOURCES_INTERNAL
118 ${ORTHANC_ROOT}/Core/Cache/MemoryCache.cpp 123 ${ORTHANC_ROOT}/Core/Cache/MemoryCache.cpp
119 ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp 124 ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp
120 ${ORTHANC_ROOT}/Core/Compression/DeflateBaseCompressor.cpp
121 ${ORTHANC_ROOT}/Core/Compression/GzipCompressor.cpp
122 ${ORTHANC_ROOT}/Core/Compression/HierarchicalZipWriter.cpp
123 ${ORTHANC_ROOT}/Core/Compression/ZipWriter.cpp
124 ${ORTHANC_ROOT}/Core/Compression/ZlibCompressor.cpp
125 ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp 125 ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp
126 ${ORTHANC_ROOT}/Core/DicomFormat/DicomImageInformation.cpp 126 ${ORTHANC_ROOT}/Core/DicomFormat/DicomImageInformation.cpp
127 ${ORTHANC_ROOT}/Core/DicomFormat/DicomInstanceHasher.cpp 127 ${ORTHANC_ROOT}/Core/DicomFormat/DicomInstanceHasher.cpp
128 ${ORTHANC_ROOT}/Core/DicomFormat/DicomIntegerPixelAccessor.cpp 128 ${ORTHANC_ROOT}/Core/DicomFormat/DicomIntegerPixelAccessor.cpp
129 ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp 129 ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp
267 ) 267 )
268 endif() 268 endif()
269 269
270 270
271 ## 271 ##
272 ## zlib support
273 ##
274
275 if (ENABLE_ZLIB)
276 include(${CMAKE_CURRENT_LIST_DIR}/ZlibConfiguration.cmake)
277 add_definitions(-DORTHANC_ENABLE_ZLIB=1)
278
279 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
280 ${ORTHANC_ROOT}/Core/Compression/DeflateBaseCompressor.cpp
281 ${ORTHANC_ROOT}/Core/Compression/HierarchicalZipWriter.cpp
282 ${ORTHANC_ROOT}/Core/Compression/GzipCompressor.cpp
283 ${ORTHANC_ROOT}/Core/Compression/ZipWriter.cpp
284 ${ORTHANC_ROOT}/Core/Compression/ZlibCompressor.cpp
285
286 # This is the minizip distribution to create ZIP files using zlib
287 ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/ioapi.c
288 ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/zip.c
289 )
290 endif()
291
292
293 ##
272 ## PNG support: libpng (in conjunction with zlib) 294 ## PNG support: libpng (in conjunction with zlib)
273 ## 295 ##
274 296
275 if (ENABLE_PNG) 297 if (ENABLE_PNG)
298 if (NOT ENABLE_ZLIB)
299 message(FATAL_ERROR "Support for zlib must be enabled if enabling libpng support")
300 endif()
301
276 include(${CMAKE_CURRENT_LIST_DIR}/LibPngConfiguration.cmake) 302 include(${CMAKE_CURRENT_LIST_DIR}/LibPngConfiguration.cmake)
277 add_definitions(-DORTHANC_ENABLE_PNG=1) 303 add_definitions(-DORTHANC_ENABLE_PNG=1)
278 304
279 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL 305 list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
280 ${ORTHANC_ROOT}/Core/Images/PngReader.cpp 306 ${ORTHANC_ROOT}/Core/Images/PngReader.cpp
331 ##################################################################### 357 #####################################################################
332 ## Inclusion of mandatory third-party dependencies 358 ## Inclusion of mandatory third-party dependencies
333 ##################################################################### 359 #####################################################################
334 360
335 include(${CMAKE_CURRENT_LIST_DIR}/JsonCppConfiguration.cmake) 361 include(${CMAKE_CURRENT_LIST_DIR}/JsonCppConfiguration.cmake)
336 include(${CMAKE_CURRENT_LIST_DIR}/ZlibConfiguration.cmake)
337 362
338 if (NOT ORTHANC_SANDBOXED) 363 if (NOT ORTHANC_SANDBOXED)
339 include(${CMAKE_CURRENT_LIST_DIR}/UuidConfiguration.cmake) 364 include(${CMAKE_CURRENT_LIST_DIR}/UuidConfiguration.cmake)
340 endif() 365 endif()
341 366
507 ${UUID_SOURCES} 532 ${UUID_SOURCES}
508 ${ZLIB_SOURCES} 533 ${ZLIB_SOURCES}
509 534
510 ${ORTHANC_ROOT}/Resources/ThirdParty/md5/md5.c 535 ${ORTHANC_ROOT}/Resources/ThirdParty/md5/md5.c
511 ${ORTHANC_ROOT}/Resources/ThirdParty/base64/base64.cpp 536 ${ORTHANC_ROOT}/Resources/ThirdParty/base64/base64.cpp
512
513 # This is the minizip distribution to create ZIP files using zlib
514 ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/ioapi.c
515 ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/zip.c
516 ) 537 )
517 538
518 set(ORTHANC_CORE_SOURCES 539 set(ORTHANC_CORE_SOURCES
519 ${ORTHANC_CORE_SOURCES_INTERNAL} 540 ${ORTHANC_CORE_SOURCES_INTERNAL}
520 ${ORTHANC_CORE_SOURCES_DEPENDENCIES} 541 ${ORTHANC_CORE_SOURCES_DEPENDENCIES}