diff CMakeLists.txt @ 2034:07f2ba3677df

Fix of Debian bug #823139 ("orthanc: Please provide RecoverCompressedFile.cpp")
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Jun 2016 12:58:25 +0200
parents e7e1858d9504
children 9dd1ee869b88
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Jun 21 11:10:34 2016 +0200
+++ b/CMakeLists.txt	Tue Jun 21 12:58:25 2016 +0200
@@ -29,8 +29,9 @@
 SET(ENABLE_JPEG ON CACHE BOOL "Enable JPEG decompression")
 SET(ENABLE_JPEG_LOSSLESS ON CACHE BOOL "Enable JPEG-LS (Lossless) decompression")
 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins")
-SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Build the ServeFolders plugin")
-SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Build the sample plugin to serve modality worklists")
+SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin")
+SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists")
+SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc")
 SET(USE_DCMTK_361 OFF CACHE BOOL "Use forthcoming DCMTK version 3.6.1 in static builds (instead of 3.6.0)")
 SET(ENABLE_PKCS11 OFF CACHE BOOL "Enable PKCS#11 for HTTPS client authentication using hardware security modules and smart cards")
 
@@ -597,6 +598,58 @@
 
 
 #####################################################################
+## Build the companion tool to recover files compressed using Orthanc
+#####################################################################
+
+if (BUILD_RECOVER_COMPRESSED_FILE)
+  set(RECOVER_COMPRESSED_SOURCES
+    Resources/Samples/Tools/RecoverCompressedFile.cpp
+    )
+
+  if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+    execute_process(
+      COMMAND 
+      ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
+      ${ORTHANC_VERSION} OrthancRecoverCompressedFile OrthancRecoverCompressedFile.exe
+      "Lightweight, RESTful DICOM server for medical imaging"
+      ERROR_VARIABLE Failure
+      OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
+      )
+
+    if (Failure)
+      message(FATAL_ERROR "Error while computing the version information: ${Failure}")
+    endif()
+
+    list(APPEND RECOVER_COMPRESSED_SOURCES
+      ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
+      )
+  endif()
+
+  add_executable(OrthancRecoverCompressedFile
+    ${RECOVER_COMPRESSED_SOURCES}
+    ${ZLIB_SOURCES}
+    ${BOOST_SOURCES}
+    ${JSONCPP_SOURCES}
+    ${PUGIXML_SOURCES}
+    ${CMAKE_SOURCE_DIR}/Core/ChunkedBuffer.cpp
+    ${CMAKE_SOURCE_DIR}/Core/Logging.cpp
+    ${CMAKE_SOURCE_DIR}/Core/Enumerations.cpp
+    ${CMAKE_SOURCE_DIR}/Core/Toolbox.cpp
+    ${CMAKE_SOURCE_DIR}/Core/Compression/DeflateBaseCompressor.cpp
+    ${CMAKE_SOURCE_DIR}/Core/Compression/ZlibCompressor.cpp
+    ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/md5/md5.c
+    ${CMAKE_SOURCE_DIR}/Resources/ThirdParty/base64/base64.cpp
+    )
+
+  install(
+    TARGETS OrthancRecoverCompressedFile
+    RUNTIME DESTINATION bin
+    )
+endif()
+
+
+
+#####################################################################
 ## Generate the documentation if Doxygen is present
 #####################################################################