Skip to content

Commit 5003c3e

Browse files
committed
COMP: Install DCMTK libraries and headers with ITK
Drop NO_INSTALL so itk_module_target() installs the DCMTK libraries into ITK's library directory and export set, and install each DCMTK module's public headers (<module>/include/dcmtk) plus the generated config headers into ITK's include tree so consumers of an installed ITK can include <dcmtk/...>. install(EXPORT ITKTargets) generates cleanly: the DCMTK targets' interface dependencies are ITK's exported codec targets, other DCMTK targets, or system libraries.
1 parent 7b156bf commit 5003c3e

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

Modules/ThirdParty/DCMTK/CMakeLists.txt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,36 @@ else(ITK_USE_SYSTEM_DCMTK)
278278

279279
# Register DCMTK's targets with ITK's module system. itk_module_target()
280280
# applies ITK's output naming, creates the namespaced ITK::<lib> aliases that
281-
# itk_module_impl() links ITKDCMTKModule against, and appends them to ITK's
282-
# build-tree targets file. Installation is handled separately, so NO_INSTALL.
281+
# itk_module_impl() links ITKDCMTKModule against, appends them to ITK's
282+
# targets file, and installs the libraries into ITK's export set.
283283
foreach(lib ${_ITKDCMTK_LIB_NAMES})
284284
if(TARGET ${lib})
285-
itk_module_target(${lib} NO_INSTALL)
285+
itk_module_target(${lib})
286286
endif()
287287
endforeach()
288288

289289
itk_module_impl()
290+
291+
# itk_module_target() installs the libraries; install DCMTK's headers into
292+
# ITK's include tree so consumers of the installed ITK can #include
293+
# <dcmtk/...>. Each DCMTK module keeps its public headers under
294+
# <module>/include/dcmtk, plus the generated osconfig.h under config/include.
295+
foreach(lib ${_ITKDCMTK_LIB_NAMES})
296+
if(EXISTS ${dcmtk_SOURCE_DIR}/${lib}/include/dcmtk)
297+
install(
298+
DIRECTORY
299+
${dcmtk_SOURCE_DIR}/${lib}/include/dcmtk
300+
DESTINATION ${ITKDCMTK_INSTALL_INCLUDE_DIR}
301+
COMPONENT Development
302+
)
303+
endif()
304+
endforeach()
305+
install(
306+
DIRECTORY
307+
${dcmtk_BINARY_DIR}/config/include/dcmtk
308+
DESTINATION ${ITKDCMTK_INSTALL_INCLUDE_DIR}
309+
COMPONENT Development
310+
)
290311
endif(ITK_USE_SYSTEM_DCMTK)
291312

292313
if(MSVC)

0 commit comments

Comments
 (0)