changeset 1914:501769757bf9

flag to remove network support in dcmtk, removal of unneeded sources in static builds
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Feb 2016 11:47:02 +0100
parents 41e402cd7b3a
children 7454019be8f3
files CMakeLists.txt Core/Images/JpegWriter.cpp Resources/CMake/DcmtkConfiguration.cmake
diffstat 3 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Mon Feb 08 11:33:39 2016 +0100
+++ b/CMakeLists.txt	Tue Feb 09 11:47:02 2016 +0100
@@ -64,6 +64,7 @@
 
 # Path to the root folder of the Orthanc distribution
 set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR})
+set(ENABLE_DCMTK_NETWORK ON)
 
 # Some basic inclusions
 include(CheckIncludeFiles)
--- a/Core/Images/JpegWriter.cpp	Mon Feb 08 11:33:39 2016 +0100
+++ b/Core/Images/JpegWriter.cpp	Tue Feb 09 11:47:02 2016 +0100
@@ -38,6 +38,7 @@
 
 #include "JpegErrorManager.h"
 
+#include <stdlib.h>
 #include <vector>
 
 namespace Orthanc
--- a/Resources/CMake/DcmtkConfiguration.cmake	Mon Feb 08 11:33:39 2016 +0100
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Tue Feb 09 11:47:02 2016 +0100
@@ -1,3 +1,7 @@
+if (NOT DEFINED ENABLE_DCMTK_NETWORKING)
+    set(ENABLE_DCMTK_NETWORKING ON)
+endif()
+
 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
   SET(DCMTK_VERSION_NUMBER 360)
   SET(DCMTK_PACKAGE_VERSION "3.6.0")
@@ -40,10 +44,15 @@
     ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
     ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
 
-  AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
   AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
   AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
 
+  if (ENABLE_DCMTK_NETWORKING)
+    AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
+    include_directories(
+      ${DCMTK_SOURCES_DIR}/dcmnet/include
+      )
+  endif()
 
   if (ENABLE_JPEG)
     AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES)
@@ -59,6 +68,16 @@
       )
     list(REMOVE_ITEM DCMTK_SOURCES 
       ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/ddpiimpl.cc
+
+      # Disable support for encoding JPEG (modification in Orthanc 1.0.1)
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djcodece.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsv1.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencbas.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencpro.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djenclol.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencode.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencext.cc
+      ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsps.cc
       )
   endif()
 
@@ -73,6 +92,9 @@
       )
     list(REMOVE_ITEM DCMTK_SOURCES 
       ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djcodece.cc
+
+      # Disable support for encoding JPEG-LS (modification in Orthanc 1.0.1)
+      ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djencode.cc
       )
     list(APPEND DCMTK_SOURCES 
       ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc
@@ -152,7 +174,6 @@
   include_directories(
     #${DCMTK_SOURCES_DIR}
     ${DCMTK_SOURCES_DIR}/config/include
-    ${DCMTK_SOURCES_DIR}/dcmnet/include
     ${DCMTK_SOURCES_DIR}/ofstd/include
     ${DCMTK_SOURCES_DIR}/oflog/include
     ${DCMTK_SOURCES_DIR}/dcmdata/include