Skip to content

Commit 4ba4656

Browse files
jcfrjamesobutlerkislinsk
committed
COMP: Support namespaced targets in updated DCMTK CMake exports
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]>
1 parent c12c0dc commit 4ba4656

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Libs/DICOM/Core/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,17 @@ set(KIT_resources
172172
# The following macro will read the target libraries from the file 'target_libraries.cmake'
173173
ctkFunctionGetTargetLibraries(KIT_target_libraries)
174174

175+
# Support namespaced DCMTK targets
176+
set(_target_libraries)
177+
foreach(target_library IN LISTS KIT_target_libraries)
178+
if(TARGET DCMTK::${target_library})
179+
list(APPEND _target_libraries DCMTK::${target_library})
180+
else()
181+
list(APPEND _target_libraries ${target_library})
182+
endif()
183+
endforeach()
184+
set(KIT_target_libraries ${_target_libraries})
185+
175186
list(APPEND KIT_target_libraries Qt${CTK_QT_VERSION}::Sql Qt${CTK_QT_VERSION}::Svg)
176187

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

0 commit comments

Comments
 (0)