changeset 2791:d015fa861e3c

selective disabling of modules in the Orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Jul 2018 21:18:05 +0200
parents c7313e1f7644
children 57e2d65d37ce
files Resources/CMake/OrthancFrameworkConfiguration.cmake Resources/CMake/OrthancFrameworkParameters.cmake
diffstat 2 files changed, 70 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/OrthancFrameworkConfiguration.cmake	Thu Jul 26 20:43:03 2018 +0200
+++ b/Resources/CMake/OrthancFrameworkConfiguration.cmake	Thu Jul 26 21:18:05 2018 +0200
@@ -124,38 +124,54 @@
 set(ORTHANC_CORE_SOURCES_INTERNAL
   ${ORTHANC_ROOT}/Core/Cache/MemoryCache.cpp
   ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp
-  ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp
-  ${ORTHANC_ROOT}/Core/DicomFormat/DicomImageInformation.cpp
-  ${ORTHANC_ROOT}/Core/DicomFormat/DicomInstanceHasher.cpp
-  ${ORTHANC_ROOT}/Core/DicomFormat/DicomIntegerPixelAccessor.cpp
-  ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp
   ${ORTHANC_ROOT}/Core/DicomFormat/DicomTag.cpp
-  ${ORTHANC_ROOT}/Core/DicomFormat/DicomValue.cpp
   ${ORTHANC_ROOT}/Core/Enumerations.cpp
   ${ORTHANC_ROOT}/Core/FileStorage/MemoryStorageArea.cpp
-  ${ORTHANC_ROOT}/Core/Images/Font.cpp
-  ${ORTHANC_ROOT}/Core/Images/FontRegistry.cpp
-  ${ORTHANC_ROOT}/Core/Images/IImageWriter.cpp
-  ${ORTHANC_ROOT}/Core/Images/Image.cpp
-  ${ORTHANC_ROOT}/Core/Images/ImageAccessor.cpp
-  ${ORTHANC_ROOT}/Core/Images/ImageBuffer.cpp
-  ${ORTHANC_ROOT}/Core/Images/ImageProcessing.cpp
-  ${ORTHANC_ROOT}/Core/Images/PamReader.cpp
-  ${ORTHANC_ROOT}/Core/Images/PamWriter.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/GenericJobUnserializer.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/JobInfo.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/JobStatus.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/JobStepResult.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/Operations/JobOperationValues.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/Operations/LogJobOperation.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/Operations/SequenceOfOperationsJob.cpp
-  ${ORTHANC_ROOT}/Core/JobsEngine/SetOfInstancesJob.cpp
   ${ORTHANC_ROOT}/Core/Logging.cpp
   ${ORTHANC_ROOT}/Core/SerializationToolbox.cpp
   ${ORTHANC_ROOT}/Core/Toolbox.cpp
   ${ORTHANC_ROOT}/Core/WebServiceParameters.cpp
   )
 
+if (ENABLE_MODULE_IMAGES)
+  list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
+    ${ORTHANC_ROOT}/Core/Images/Font.cpp
+    ${ORTHANC_ROOT}/Core/Images/FontRegistry.cpp
+    ${ORTHANC_ROOT}/Core/Images/IImageWriter.cpp
+    ${ORTHANC_ROOT}/Core/Images/Image.cpp
+    ${ORTHANC_ROOT}/Core/Images/ImageAccessor.cpp
+    ${ORTHANC_ROOT}/Core/Images/ImageBuffer.cpp
+    ${ORTHANC_ROOT}/Core/Images/ImageProcessing.cpp
+    ${ORTHANC_ROOT}/Core/Images/PamReader.cpp
+    ${ORTHANC_ROOT}/Core/Images/PamWriter.cpp
+    )
+endif()
+
+if (ENABLE_MODULE_DICOM)
+  list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
+    ${ORTHANC_ROOT}/Core/DicomFormat/DicomArray.cpp
+    ${ORTHANC_ROOT}/Core/DicomFormat/DicomImageInformation.cpp
+    ${ORTHANC_ROOT}/Core/DicomFormat/DicomInstanceHasher.cpp
+    ${ORTHANC_ROOT}/Core/DicomFormat/DicomIntegerPixelAccessor.cpp
+    ${ORTHANC_ROOT}/Core/DicomFormat/DicomMap.cpp
+    ${ORTHANC_ROOT}/Core/DicomFormat/DicomValue.cpp
+    )
+endif()
+
+if (ENABLE_MODULE_JOBS)
+  list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
+    ${ORTHANC_ROOT}/Core/JobsEngine/GenericJobUnserializer.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/JobInfo.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/JobStatus.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/JobStepResult.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/Operations/JobOperationValues.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/Operations/LogJobOperation.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/Operations/SequenceOfOperationsJob.cpp
+    ${ORTHANC_ROOT}/Core/JobsEngine/SetOfInstancesJob.cpp
+    )
+endif()
+
+
 
 #####################################################################
 ## Configuration of optional third-party dependencies
@@ -272,6 +288,10 @@
 ##
 
 if (ENABLE_JPEG)
+  if (NOT ENABLE_MODULE_IMAGES)
+    message(FATAL_ERROR "Image processing primitives must be enabled if enabling libjpeg support")
+  endif()
+
   include(${CMAKE_CURRENT_LIST_DIR}/LibJpegConfiguration.cmake)
   add_definitions(-DORTHANC_ENABLE_JPEG=1)
 
@@ -316,6 +336,10 @@
     message(FATAL_ERROR "Support for zlib must be enabled if enabling libpng support")
   endif()
 
+  if (NOT ENABLE_MODULE_IMAGES)
+    message(FATAL_ERROR "Image processing primitives must be enabled if enabling libpng support")
+  endif()
+  
   include(${CMAKE_CURRENT_LIST_DIR}/LibPngConfiguration.cmake)
   add_definitions(-DORTHANC_ENABLE_PNG=1)
 
@@ -397,7 +421,11 @@
 
 if (ENABLE_DCMTK)
   if (NOT ENABLE_LOCALE)
-    message(FATAL_ERROR "Support for locales must be enabled if enabling DICOM support")
+    message(FATAL_ERROR "Support for locales must be enabled if enabling DCMTK support")
+  endif()
+
+  if (NOT ENABLE_MODULE_DICOM)
+    message(FATAL_ERROR "DICOM module must be enabled if enabling DCMTK support")
   endif()
 
   include(${CMAKE_CURRENT_LIST_DIR}/DcmtkConfiguration.cmake)
@@ -502,14 +530,19 @@
   list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
     ${ORTHANC_ROOT}/Core/Cache/SharedArchive.cpp
     ${ORTHANC_ROOT}/Core/FileStorage/FilesystemStorage.cpp
-    ${ORTHANC_ROOT}/Core/JobsEngine/JobsEngine.cpp
-    ${ORTHANC_ROOT}/Core/JobsEngine/JobsRegistry.cpp
     ${ORTHANC_ROOT}/Core/MultiThreading/RunnableWorkersPool.cpp
     ${ORTHANC_ROOT}/Core/MultiThreading/SharedMessageQueue.cpp
     ${ORTHANC_ROOT}/Core/SharedLibrary.cpp
     ${ORTHANC_ROOT}/Core/SystemToolbox.cpp
     ${ORTHANC_ROOT}/Core/TemporaryFile.cpp
     )
+
+  if (ENABLE_MODULE_JOBS)
+    list(APPEND ORTHANC_CORE_SOURCES_INTERNAL
+      ${ORTHANC_ROOT}/Core/JobsEngine/JobsEngine.cpp
+      ${ORTHANC_ROOT}/Core/JobsEngine/JobsRegistry.cpp
+      )
+  endif()
 endif()
 
 
--- a/Resources/CMake/OrthancFrameworkParameters.cmake	Thu Jul 26 20:43:03 2018 +0200
+++ b/Resources/CMake/OrthancFrameworkParameters.cmake	Thu Jul 26 21:18:05 2018 +0200
@@ -105,3 +105,14 @@
 
 set(ORTHANC_SANDBOXED OFF CACHE INTERNAL
   "Whether Orthanc runs inside a sandboxed environment (such as Google NaCl or WebAssembly)")
+
+
+#
+# These options can be used to turn off some modules of the Orthanc
+# framework, in order to speed up the compilation time of third-party
+# projects.
+#
+
+set(ENABLE_MODULE_IMAGES ON CACHE INTERNAL "Enable module for image processing")
+set(ENABLE_MODULE_JOBS ON CACHE INTERNAL "Enable module for jobs")
+set(ENABLE_MODULE_DICOM ON CACHE INTERNAL "Enable module for DICOM handling")