From db9c0489210d101e9f14f7748e255e0d77b7e910 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 11 Mar 2024 15:30:24 -0400 Subject: [PATCH 1/2] ENH: Bump DCMTK to 2024-03-11 master We can drop the arith.h patch because it was removed in: https://github.com/DCMTK/dcmtk/commit/5714b4c043dc0c2cbc4c66ea104cc4c9c5659b32 We also need to add oficonv to the linked libraries for the default build. Remove the Apple workaround since we are linking oficonv. --- Modules/ThirdParty/DCMTK/CMakeLists.txt | 12 +----------- Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake | 11 ++++------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Modules/ThirdParty/DCMTK/CMakeLists.txt b/Modules/ThirdParty/DCMTK/CMakeLists.txt index 93dabfb9a87..dd868017b52 100644 --- a/Modules/ThirdParty/DCMTK/CMakeLists.txt +++ b/Modules/ThirdParty/DCMTK/CMakeLists.txt @@ -78,18 +78,8 @@ else(DCMTK_USE_ICU) ) endif() -if(APPLE) - # Character set conversion creates linking errors on MacOS. We disable - # `iconv` which is likely going to be found on the system by DCMTK, and - # that is going to create linking errors. - list(APPEND - CHARSET_CONVERSION_ARGS - -DDCMTK_WITH_ICONV:BOOL=OFF - ) -endif() - set(_ITKDCMTK_LIB_NAMES dcmdata dcmimage dcmimgle dcmjpeg dcmjpls - dcmnet dcmpstat dcmqrdb dcmsr dcmtls ijg12 ijg16 ijg8 oflog ofstd) + dcmnet dcmpstat dcmqrdb dcmsr dcmtls ijg12 ijg16 ijg8 oflog ofstd oficonv) if(WIN32) set(ITKDCMTK_LIBDEP_WIN iphlpapi ws2_32 netapi32 wsock32) endif() diff --git a/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake b/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake index 304e6782211..5e79034e0d6 100644 --- a/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake +++ b/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake @@ -1,7 +1,7 @@ # Set GIT tag here for use in multiple CMakeLists.txt # set(DCMTK_GIT_REPOSITORY "https://github.com/InsightSoftwareConsortium/DCMTK.git") -# 2020.02.14 patched +# 2024.03.11 patched # Patch list: #Francois Budin (1): @@ -13,10 +13,7 @@ set(DCMTK_GIT_REPOSITORY "https://github.com/InsightSoftwareConsortium/DCMTK.git #Jean-Christophe Fillion-Robin (1): #COMP: Set 3rd party package CMake variables only if needed - #Matt McCormick (2): - #Support CMAKE_CROSSCOMPILING_EMULATOR - #Support the generation of arith.h with Emscription + #Matt McCormick (1): + #Support CMAKE_CROSSCOMPILING_EMULATOR # pushed upstream in https://github.com/DCMTK/dcmtk/pull/94 - - -set(DCMTK_GIT_TAG "cba5794fb294ca7a473a70dd97fdee115922a348") # 20220117_DCMTK_PATCHES_FOR_ITK +set(DCMTK_GIT_TAG "bed2645624b30823189b1afa0d0feb8c8964847e") # 20240311_DCMTK_PATCHES_FOR_ITK From 1ed8ead451e28438ff1bc9d09c4b91fcba81e8c2 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 13 Mar 2024 14:27:03 -0400 Subject: [PATCH 2/2] ENH: Enable DCMTK_ENABLE_BUILTIN_OFICONV_DATA by default As suggested by Michael Onken > By default, the oficonv library makes use of character set conversion tables that are loaded from files during runtime. In order to pre-compile those tables into the oficonv library, you can set the CMake option DCMTK_ENABLE_BUILTIN_OFICONV_DATA (ON). --- Modules/ThirdParty/DCMTK/CMakeLists.txt | 1 + Modules/ThirdParty/DCMTK/itk-module-init.cmake | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Modules/ThirdParty/DCMTK/CMakeLists.txt b/Modules/ThirdParty/DCMTK/CMakeLists.txt index dd868017b52..5aaf18f2ebf 100644 --- a/Modules/ThirdParty/DCMTK/CMakeLists.txt +++ b/Modules/ThirdParty/DCMTK/CMakeLists.txt @@ -327,6 +327,7 @@ endforeach() -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} -DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR} -DCMAKE_INSTALL_BINDIR:PATH=${CMAKE_INSTALL_BINDIR} + -DDCMTK_ENABLE_BUILTIN_OFICONV_DATA:BOOL=${DCMTK_ENABLE_BUILTIN_OFICONV_DATA} ${CHARSET_CONVERSION_ARGS} DEPENDS ${JPEG_DEPENDENCY} ${PNG_DEPENDENCY} ${TIFF_DEPENDENCY} ${ICU_DEPENDENCY} BUILD_BYPRODUCTS ${DCMTK_BYPRODUCTS} diff --git a/Modules/ThirdParty/DCMTK/itk-module-init.cmake b/Modules/ThirdParty/DCMTK/itk-module-init.cmake index 941f06d98e7..fcfe495ba1e 100644 --- a/Modules/ThirdParty/DCMTK/itk-module-init.cmake +++ b/Modules/ThirdParty/DCMTK/itk-module-init.cmake @@ -26,6 +26,8 @@ if(ITK_USE_SYSTEM_DCMTK) list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/CMake") find_package(DCMTK REQUIRED NO_MODULE) else(ITK_USE_SYSTEM_DCMTK) + # Change default from OFF to ON for portability. + option(DCMTK_ENABLE_BUILTIN_OFICONV_DATA "Embed oficonv data files into oficonv library" ON) # Copied and mofified from DCMTK/CMake/3rdparty.cmake if(NOT DEFINED DCMTK_USE_ICU) include(CheckCXXSourceCompiles)