[dcmtk] add openjpeg feature (#46585)

Co-authored-by: Nick D'Ademo <dademo.n@duerr-ndt.com>
Co-authored-by: Kai Pastor <dg0yt@darc.de>
This commit is contained in:
Nick D'Ademo 2025-09-04 09:10:22 +08:00 committed by GitHub
parent ca519a073d
commit 96ff71a4a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 33 additions and 14 deletions

View File

@ -2,13 +2,14 @@ diff --git a/CMake/3rdparty.cmake b/CMake/3rdparty.cmake
index 510027c..eb8fe90 100644
--- a/CMake/3rdparty.cmake
+++ b/CMake/3rdparty.cmake
@@ -1,3 +1,10 @@
@@ -1,3 +1,11 @@
+set(CMAKE_REQUIRE_FIND_PACKAGE_Iconv "${DCMTK_WITH_ICONV}")
+set(CMAKE_REQUIRE_FIND_PACKAGE_LibXml2 "${DCMTK_WITH_XML}")
+set(CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL "${DCMTK_WITH_OPENSSL}")
+set(CMAKE_REQUIRE_FIND_PACKAGE_PNG "${DCMTK_WITH_PNG}")
+set(CMAKE_REQUIRE_FIND_PACKAGE_TIFF "${DCMTK_WITH_TIFF}")
+set(CMAKE_REQUIRE_FIND_PACKAGE_ZLIB "${DCMTK_WITH_ZLIB}")
+set(CMAKE_REQUIRE_FIND_PACKAGE_OpenJPEG "${DCMTK_WITH_OPENJPEG}")
+
set(USE_FIND_PACKAGE_DOCS "Control whether libraries are searched via CMake's find_package() mechanism or a Windows specific fallback")
# Advanced user (eg. vcpkg) may want to override this:

View File

@ -15,6 +15,7 @@ vcpkg_from_github(
file(REMOVE
"${SOURCE_PATH}/CMake/FindICONV.cmake"
"${SOURCE_PATH}/CMake/FindJPEG.cmake"
"${SOURCE_PATH}/CMake/FindOpenJPEG.cmake"
)
# Prefix all exported API symbols of vendored libjpeg with "dcmtk_"
@ -45,6 +46,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
"tiff" DCMTK_WITH_TIFF
"xml2" DCMTK_WITH_XML
"zlib" DCMTK_WITH_ZLIB
"openjpeg" DCMTK_WITH_OPENJPEG
"tools" BUILD_APPS
)
@ -72,7 +74,6 @@ vcpkg_cmake_configure(
-DDCMTK_USE_FIND_PACKAGE=ON
-DDCMTK_WIDE_CHAR_FILE_IO_FUNCTIONS=ON
-DDCMTK_WIDE_CHAR_MAIN_FUNCTION=ON
-DDCMTK_WITH_OPENJPEG=OFF
-DDCMTK_WITH_DOXYGEN=OFF
-DDCMTK_WITH_SNDFILE=OFF
-DDCMTK_WITH_WRAP=OFF
@ -157,6 +158,10 @@ endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin")
endif()
# no absolute paths
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h"
"#define (DCMTK_PREFIX|DCM_DICT_DEFAULT_PATH|DEFAULT_CONFIGURATION_DIR|DEFAULT_SUPPORT_DATA_DIR) \"[^\"]*\""

View File

@ -1,7 +1,7 @@
{
"name": "dcmtk",
"version": "3.6.9",
"port-version": 1,
"port-version": 2,
"description": "This DICOM ToolKit (DCMTK) package consists of source code, documentation and installation instructions for a set of software libraries and applications implementing part of the DICOM/MEDICOM Standard.",
"homepage": "https://github.com/DCMTK/dcmtk",
"license": null,
@ -30,6 +30,12 @@
"libiconv"
]
},
"openjpeg": {
"description": "Enable OpenJPEG support",
"dependencies": [
"openjpeg"
]
},
"openssl": {
"description": "Enable OpenSSL",
"dependencies": [

View File

@ -779,7 +779,6 @@ darknet[opencv3-base]:arm64-osx = cascade
dartsim(uwp) = cascade
daxa:x64-uwp = cascade
dcmtk[icu](uwp) = cascade
dcmtk[icu](uwp) = cascade
devil[openexr]:arm64-uwp = cascade
devil[openexr]:x64-uwp = cascade
directxtex[core,dx11,dx12,openexr,spectre,tools]:arm64-windows-static-md = combination-fails # error LNK2047: module contains C++ EH or complex EH metadata but was not compiled with /guard:ehcont
@ -2098,7 +2097,9 @@ crashrpt(windows) = fail # precompiled header errors. See https://github.com/mic
ctbench(osx) = fail # requires C++ 20
date[remote-api](uwp) = feature-fails # error C2065: 'FOLDERID_ProgramFiles': undeclared identifier. See https://github.com/microsoft/vcpkg/issues/33610
dcmtk[core,iconv,icu,openssl,png,tiff,tools,xml2,zlib](osx) = combination-fails # missing symbols from libtiff. See https://github.com/microsoft/vcpkg/issues/33512
dcmtk[xml2](windows) = feature-fails # fatal error C1083: Cannot open include file: 'iconv.h'. See https://github.com/microsoft/vcpkg/issues/33473
dcmtk[iconv](arm64 & windows & !uwp) = feature-fails # try_run
dcmtk[tools](arm64 & windows & !uwp) = feature-fails # try_run
dcmtk(android) = fail # try_run
dcmtk(uwp) = fail # Please set the C++ runtime location (required for running applications targeting Windows). See https://github.com/microsoft/vcpkg/issues/35112
dmlc[openmp](osx) = feature-fails # No openmp on osx
dv-processing[tools](osx) = feature-fails # Broke with compiler version. See https://github.com/microsoft/vcpkg/issues/39852

View File

@ -13,7 +13,8 @@
"tiff",
"tools",
"xml2",
"zlib"
"zlib",
"openjpeg"
]
},
{

View File

@ -2366,7 +2366,7 @@
},
"dcmtk": {
"baseline": "3.6.9",
"port-version": 1
"port-version": 2
},
"debug-assert": {
"baseline": "1.3.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0ff9c4eff525cb8cf1d04bf9952dc9446c3eef3a",
"version": "3.6.9",
"port-version": 2
},
{
"git-tree": "6445ef976bd199730e54bd775a4a4d111aac84c6",
"version": "3.6.9",