changeset 1785:c131566b8252 dcmtk-3.6.1

integration mainline->dcmtk-3.6.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 10:16:21 +0100
parents 1b82bb0446d2 (diff) 2dbf25006f88 (current diff)
children 4f2386d0f326
files Core/DicomFormat/DicomNullValue.h Core/DicomFormat/DicomString.h Core/MultiThreading/BagOfRunnablesBySteps.cpp Core/MultiThreading/BagOfRunnablesBySteps.h OrthancServer/DicomFindQuery.cpp OrthancServer/DicomFindQuery.h OrthancServer/ResourceFinder.cpp OrthancServer/ResourceFinder.h Resources/CMake/Compiler.cmake Resources/CMake/DcmtkConfiguration.cmake
diffstat 6 files changed, 56 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/Compiler.cmake	Wed Nov 18 09:56:34 2015 +0100
+++ b/Resources/CMake/Compiler.cmake	Wed Nov 18 10:16:21 2015 +0100
@@ -42,7 +42,6 @@
     -D_CRT_SECURE_NO_DEPRECATE=1
     )
   include_directories(${ORTHANC_ROOT}/Resources/ThirdParty/VisualStudio)
-  link_libraries(netapi32)
 endif()
 
 
@@ -69,6 +68,8 @@
   endif()
 
 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  link_libraries(netapi32)
+
   if (MSVC)
     message("MSVC compiler version = " ${MSVC_VERSION} "\n")
     # Starting Visual Studio 2013 (version 1800), it is not possible
--- a/Resources/CMake/DcmtkConfiguration.cmake	Wed Nov 18 09:56:34 2015 +0100
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Wed Nov 18 10:16:21 2015 +0100
@@ -1,9 +1,9 @@
 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
-  SET(DCMTK_VERSION_NUMBER 360)
-  set(DCMTK_PACKAGE_VERSION "3.6.0")
-  SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
-  SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip")
-  SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4")
+  SET(DCMTK_VERSION_NUMBER 361)
+  set(DCMTK_PACKAGE_VERSION "3.6.1")
+  SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1_20150629)
+  SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.1_20150629.tar.gz")
+  SET(DCMTK_MD5 "2faf73786fc638ae05fef0103cce0eea")
 
   if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}")
     set(FirstRun OFF)
@@ -11,6 +11,15 @@
     set(FirstRun ON)
   endif()
 
+  # Definitions for DCMTK 3.6.1
+  macro(DCMTK_UNSET)
+  endmacro()
+
+  set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
+  add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
+  # End
+
+
   DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}")
 
   IF (CMAKE_CROSSCOMPILING)
@@ -40,6 +49,18 @@
     ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
     ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
 
+
+  execute_process(
+    COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-speed.patch
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    RESULT_VARIABLE Failure
+    )
+
+  if (Failure AND FirstRun)
+    message(FATAL_ERROR "Error while patching a file")
+  endif()
+
+
   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)
@@ -87,49 +108,16 @@
       ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
       ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
     list(REMOVE_ITEM DCMTK_SOURCES 
+      ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
       ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
       ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
       )
     
-    execute_process(
-      COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-      RESULT_VARIABLE Failure
-      )
-
-    if (Failure AND FirstRun)
-      message(FATAL_ERROR "Error while patching a file")
-    endif()
-
   elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
     list(REMOVE_ITEM DCMTK_SOURCES 
+      ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
       ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
       )
-
-    if (CMAKE_COMPILER_IS_GNUCXX)
-      # This is a patch for MinGW64
-      execute_process(
-        COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-mingw64.patch
-        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-        RESULT_VARIABLE Failure
-        )
-
-      if (Failure AND FirstRun)
-        message(FATAL_ERROR "Error while patching a file")
-      endif()
-    endif()
-
-    # This patch improves speed, even for Windows
-    execute_process(
-      COMMAND ${PATCH_EXECUTABLE} -p0 -N 
-      INPUT_FILE ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-      RESULT_VARIABLE Failure
-      )
-
-    if (Failure AND FirstRun)
-      message(FATAL_ERROR "Error while patching a file")
-    endif()
   endif()
 
   list(REMOVE_ITEM DCMTK_SOURCES 
--- a/Resources/Patches/dcmtk-linux-speed.patch	Wed Nov 18 09:56:34 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-diff -urEb dcmtk-3.6.0.orig/dcmnet/libsrc/dul.cc dcmtk-3.6.0/dcmnet/libsrc/dul.cc
---- dcmtk-3.6.0.orig/dcmnet/libsrc/dul.cc	2010-12-01 09:26:36.000000000 +0100
-+++ dcmtk-3.6.0/dcmnet/libsrc/dul.cc	2015-05-15 17:03:50.762451757 +0200
-@@ -1840,7 +1840,7 @@
-     }
- #endif
- #endif
--    setTCPBufferLength(sock);
-+    //setTCPBufferLength(sock);
- 
- #ifndef DONT_DISABLE_NAGLE_ALGORITHM
-     /*
-diff -urEb dcmtk-3.6.0.orig/dcmnet/libsrc/dulfsm.cc dcmtk-3.6.0/dcmnet/libsrc/dulfsm.cc
---- dcmtk-3.6.0.orig/dcmnet/libsrc/dulfsm.cc	2010-12-01 09:26:36.000000000 +0100
-+++ dcmtk-3.6.0/dcmnet/libsrc/dulfsm.cc	2015-05-15 17:03:55.570451952 +0200
-@@ -2417,7 +2417,7 @@
-           return makeDcmnetCondition(DULC_TCPINITERROR, OF_error, msg.c_str());
-         }
- #endif
--        setTCPBufferLength(s);
-+        //setTCPBufferLength(s);
- 
- #ifndef DONT_DISABLE_NAGLE_ALGORITHM
-         /*
--- a/Resources/Patches/dcmtk-mingw64.patch	Wed Nov 18 09:56:34 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-diff -urEb dcmtk-3.6.0.orig/ofstd/include/dcmtk/ofstd/offile.h dcmtk-3.6.0/ofstd/include/dcmtk/ofstd/offile.h
---- dcmtk-3.6.0.orig/ofstd/include/dcmtk/ofstd/offile.h	2010-12-17 11:50:30.000000000 +0100
-+++ dcmtk-3.6.0/ofstd/include/dcmtk/ofstd/offile.h	2013-07-19 15:56:25.688996134 +0200
-@@ -196,7 +196,7 @@
-   OFBool popen(const char *command, const char *modes)
-   {
-     if (file_) fclose();
--#ifdef _WIN32
-+#if 0
-     file_ = _popen(command, modes);
- #else
-     file_ = :: popen(command, modes);
-@@ -258,7 +258,7 @@
-     {
-       if (popened_)
-       {
--#ifdef _WIN32
-+#if 0
-         result = _pclose(file_);
- #else
-         result = :: pclose(file_);
-Only in dcmtk-3.6.0/ofstd/include/dcmtk/ofstd: offile.h~
--- a/Resources/Patches/dcmtk-mingw64.txt	Wed Nov 18 09:56:34 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-diff -urEb dcmtk-3.6.0.orig/ dcmtk-3.6.0 > ../Resources/Patches/dcmtk-mingw64.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Patches/dcmtk-speed.patch	Wed Nov 18 10:16:21 2015 +0100
@@ -0,0 +1,26 @@
+diff -r -u dcmtk-3.6.1_20150629.orig/dcmnet/libsrc/dul.cc dcmtk-3.6.1_20150629/dcmnet/libsrc/dul.cc
+--- dcmtk-3.6.1_20150629.orig/dcmnet/libsrc/dul.cc	2015-06-29 10:56:45.000000000 +0200
++++ dcmtk-3.6.1_20150629/dcmnet/libsrc/dul.cc	2015-09-23 10:18:58.796546032 +0200
+@@ -1833,7 +1833,7 @@
+         return makeDcmnetCondition(DULC_TCPINITERROR, OF_error, msg.c_str());
+     }
+ #endif
+-    setTCPBufferLength(sock);
++    //setTCPBufferLength(sock);
+ 
+ #ifndef DONT_DISABLE_NAGLE_ALGORITHM
+     /*
+Only in dcmtk-3.6.1_20150629/dcmnet/libsrc: dul.cc~
+diff -r -u dcmtk-3.6.1_20150629.orig/dcmnet/libsrc/dulfsm.cc dcmtk-3.6.1_20150629/dcmnet/libsrc/dulfsm.cc
+--- dcmtk-3.6.1_20150629.orig/dcmnet/libsrc/dulfsm.cc	2015-06-29 10:56:45.000000000 +0200
++++ dcmtk-3.6.1_20150629/dcmnet/libsrc/dulfsm.cc	2015-09-23 10:19:10.088545747 +0200
+@@ -2421,7 +2421,7 @@
+           return makeDcmnetCondition(DULC_TCPINITERROR, OF_error, msg.c_str());
+         }
+ #endif
+-        setTCPBufferLength(s);
++        //setTCPBufferLength(s);
+ 
+ #ifndef DONT_DISABLE_NAGLE_ALGORITHM
+         /*
+Only in dcmtk-3.6.1_20150629/dcmnet/libsrc: dulfsm.cc~