changeset 2500:3b802ac81a27

dcmtk-3.6.2-cmath.patch
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 24 Mar 2018 11:29:02 +0100
parents 0188c21e417a
children 58e4a48c322c
files Resources/CMake/DcmtkConfiguration.cmake Resources/Patches/dcmtk-3.6.2-cmath.patch
diffstat 2 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/DcmtkConfiguration.cmake	Thu Mar 22 17:31:36 2018 +0100
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Sat Mar 24 11:29:02 2018 +0100
@@ -81,8 +81,18 @@
         message(FATAL_ERROR "Error while patching a file")
       endif()
 
-    else (FirstRun())
-      message("No need to apply a patch for speed in DCMTK")
+    else()
+      message("Applying patch to detect mathematic primitives in DCMTK 3.6.2")
+      execute_process(
+        COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
+        ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-cmath.patch
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+        RESULT_VARIABLE Failure
+        )
+
+      if (Failure)
+        message(FATAL_ERROR "Error while patching a file")
+      endif()
     endif()
   else()
     message("The patches for DCMTK have already been applied")
@@ -99,8 +109,6 @@
   
   if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
     SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "")
-    SET(HAVE_PROTOTYPE_STD__ISINF 1 CACHE INTERNAL "")
-    SET(HAVE_PROTOTYPE_STD__ISNAN 1 CACHE INTERNAL "")
     SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "")
 
     execute_process(
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Patches/dcmtk-3.6.2-cmath.patch	Sat Mar 24 11:29:02 2018 +0100
@@ -0,0 +1,17 @@
+diff -urEb dcmtk-3.6.2.orig/CMake/GenerateDCMTKConfigure.cmake dcmtk-3.6.2/CMake/GenerateDCMTKConfigure.cmake
+--- dcmtk-3.6.2.orig/CMake/GenerateDCMTKConfigure.cmake	2018-03-24 11:19:13.705396611 +0100
++++ dcmtk-3.6.2/CMake/GenerateDCMTKConfigure.cmake	2018-03-24 11:19:33.429286501 +0100
+@@ -571,9 +571,9 @@
+   CHECK_FUNCTIONWITHHEADER_EXISTS(isinf "${HEADERS}" HAVE_PROTOTYPE_ISINF)
+   CHECK_FUNCTIONWITHHEADER_EXISTS(isnan "${HEADERS}" HAVE_PROTOTYPE_ISNAN)
+   CHECK_FUNCTIONWITHHEADER_EXISTS(finite "${HEADERS}" HAVE_PROTOTYPE_FINITE)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS(std::isinf "${HEADERS}" HAVE_PROTOTYPE_STD__ISINF)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS(std::isnan "${HEADERS}" HAVE_PROTOTYPE_STD__ISNAN)
+-  CHECK_FUNCTIONWITHHEADER_EXISTS(std::finite "${HEADERS}" HAVE_PROTOTYPE_STD__FINITE)
++  CHECK_FUNCTIONWITHHEADER_EXISTS(std::isinf<double> "${HEADERS}" HAVE_PROTOTYPE_STD__ISINF)
++  CHECK_FUNCTIONWITHHEADER_EXISTS(std::isnan<double> "${HEADERS}" HAVE_PROTOTYPE_STD__ISNAN)
++  CHECK_FUNCTIONWITHHEADER_EXISTS(std::finite<double> "${HEADERS}" HAVE_PROTOTYPE_STD__FINITE)
+   CHECK_FUNCTIONWITHHEADER_EXISTS(flock "${HEADERS}" HAVE_PROTOTYPE_FLOCK)
+   CHECK_FUNCTIONWITHHEADER_EXISTS(gethostbyname "${HEADERS}" HAVE_PROTOTYPE_GETHOSTBYNAME)
+   CHECK_FUNCTIONWITHHEADER_EXISTS(gethostbyname_r "${HEADERS}" HAVE_PROTOTYPE_GETHOSTBYNAME_R)
+Only in dcmtk-3.6.2/CMake: GenerateDCMTKConfigure.cmake~