Skip to content

Commit

Permalink
COMP: Support namespaced targets in updated DCMTK CMake exports
Browse files Browse the repository at this point in the history
This update maintains backward compatibility while enabling support for DCMTK's
namespaced CMake targets, introduced in commit DCMTK/dcmtk@c684bb3 ("Various enhancements for DCMTK's CMake exports.", 2021-07-05).

In this version, target names are prefixed with "DCMTK::", requiring adjustments
to the build system ensuring the variable KIT_target_libraries is properly
set.

Co-authored-by: James Butler <[email protected]>
Co-authored-by: Stefan Dinkelacker <[email protected]>
  • Loading branch information
3 people committed Oct 29, 2024
1 parent c12c0dc commit 4ba4656
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Libs/DICOM/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ set(KIT_resources
# The following macro will read the target libraries from the file 'target_libraries.cmake'
ctkFunctionGetTargetLibraries(KIT_target_libraries)

# Support namespaced DCMTK targets
set(_target_libraries)
foreach(target_library IN LISTS KIT_target_libraries)
if(TARGET DCMTK::${target_library})
list(APPEND _target_libraries DCMTK::${target_library})
else()
list(APPEND _target_libraries ${target_library})
endif()
endforeach()
set(KIT_target_libraries ${_target_libraries})

list(APPEND KIT_target_libraries Qt${CTK_QT_VERSION}::Sql Qt${CTK_QT_VERSION}::Svg)

# create a dcm query/retrieve service config file that points to the build dir
Expand Down

0 comments on commit 4ba4656

Please sign in to comment.