Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dcmtk] no absolute paths #21277

Merged
merged 1 commit into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions ports/dcmtk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ vcpkg_from_github(
PATCHES ${CMAKE_CURRENT_LIST_DIR}/dcmtk.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DDCMTK_WITH_DOXYGEN=OFF
-DDCMTK_WITH_ZLIB=OFF
Expand All @@ -34,13 +33,18 @@ vcpkg_configure_cmake(
-DINSTALL_OTHER=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets()
vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DCMTK_PREFIX \"${CURRENT_PACKAGES_DIR}\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DCM_DICT_DEFAULT_PATH \"${CURRENT_PACKAGES_DIR}/share/dcmtk/dicom.dic:${CURRENT_PACKAGES_DIR}/share/dcmtk/private.dic\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DEFAULT_CONFIGURATION_DIR \"${CURRENT_PACKAGES_DIR}/etc/dcmtk/\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/dcmtk/config/osconfig.h" "#define DEFAULT_SUPPORT_DATA_DIR \"${CURRENT_PACKAGES_DIR}/share/dcmtk/\"" "")
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/dcmtk RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/dcmtk" RENAME copyright)
18 changes: 18 additions & 0 deletions ports/dcmtk/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The package dcmtk provides CMake targets:

find_package(DCMTK CONFIG REQUIRED)
# Note: 23 target(s) were omitted.
target_link_libraries(main PRIVATE cmr i2d ijg8 dcmfg)

Add the following cmake code to your CMakeLists.txt to create definitions for DCMTK
if ("${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" STREQUAL "/")
message(WARNING "No vcpkg install dir found, DCMTK definitions are not set")
else()
target_compile_definitions(main
PUBLIC
"DCMTK_PREFIX=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}"
"DCM_DICT_DEFAULT_PATH=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk/dicom.dic:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk/private.dic"
"DEFAULT_CONFIGURATION_DIR=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/etc/dcmtk/"
"DEFAULT_SUPPORT_DATA_DIR=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk/"
)
endif()
14 changes: 12 additions & 2 deletions ports/dcmtk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"name": "dcmtk",
"version-string": "3.6.6",
"port-version": 1,
"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."
"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.",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@
},
"dcmtk": {
"baseline": "3.6.6",
"port-version": 1
"port-version": 2
},
"debug-assert": {
"baseline": "1.3.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/dcmtk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "24716759e4aa3fb67b014163ae3be95ad88120b6",
"version-string": "3.6.6",
"port-version": 2
},
{
"git-tree": "6b830172b906fea2468685175d0ecca5f374217c",
"version-string": "3.6.6",
Expand Down