Commit 7f051c5
committed
Fix OpenJPEG target handling in DCMTKConfig.cmake
When DCMTK is built with OpenJPEG support, DCMTKTargets.cmake contains
INTERFACE_LINK_LIBRARIES entries that reference the imported target
openjp2. If a consuming project includes DCMTKConfig.cmake without
previously finding OpenJPEG, CMake errors out because the openjp2
target does not exist.
Fix by calling find_package(OpenJPEG) in DCMTKConfig.cmake before the
DCMTK targets are imported, but only when DCMTK was built with
OpenJPEG support and the openjp2 target has not already been defined.
This ensures the openjp2 target is available when DCMTKTargets.cmake
is processed, without forcing projects that already found OpenJPEG
themselves to find it again.1 parent 969c4b6 commit 7f051c5
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
0 commit comments