Skip to content

Commit da1c2fe

Browse files
authored
Merge pull request #6496 from blowekamp/dcmtk-private-depends
ENH: Make ITKDCMTK a private dependency of ITKIODCMTK and IOTransformDCMTK
2 parents c8c14a8 + 946dc77 commit da1c2fe

7 files changed

Lines changed: 23 additions & 5 deletions

File tree

Modules/IO/DCMTK/itk-module.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ itk_module(
99
ENABLE_SHARED
1010
DEPENDS
1111
ITKIOImageBase
12+
PRIVATE_DEPENDS
1213
ITKDCMTK
1314
TEST_DEPENDS
1415
ITKTestKernel

Modules/IO/DCMTK/src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ itk_module_add_library(
1010
ITKIODCMTK
1111
${ITKIODCMTK_SRC}
1212
)
13+
14+
# itkDCMTKFileReader.h is an internal header in this directory (not installed).
15+
target_include_directories(ITKIODCMTK PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
16+
1317
if(DEFINED DCMTK_HAVE_CONFIG_H_OPTIONAL AND NOT DCMTK_HAVE_CONFIG_H_OPTIONAL)
1418
# Workaround Debian packaging issue - See FindDCMTK.cmake for more details
1519
target_compile_definitions(ITKIODCMTK PRIVATE ${DCMTK_DEFINITIONS})
File renamed without changes.

Modules/IO/DCMTK/test/CMakeLists.txt

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@ set(
1818

1919
createtestdriver(ITKIODCMTK "${ITKIODCMTK-Test_LIBRARIES}" "${ITKIODCMTKTests}")
2020

21-
# itkDCMTKFileReader.h transitively #include's dcmtk/dcmdata/*.h. ITKIODCMTK
22-
# declares ITKDCMTK as a PRIVATE_DEPENDS (so consumers don't see DCMTK
23-
# headers), but the test driver consumes the public itkDCMTKFileReader.h
24-
# directly and therefore needs the DCMTK include path on its compile line.
25-
# Tracks issue #3820. Reconstruct the include path the same way
21+
# itkDCMTKFileReader.h is a private implementation header in src/ (not
22+
# installed). itkDCMTKGetDicomTagsTest.cxx includes it directly, so the test
23+
# driver needs the src/ directory on its compile line.
24+
target_include_directories(
25+
ITKIODCMTKTestDriver
26+
PRIVATE
27+
"${CMAKE_CURRENT_SOURCE_DIR}/../src"
28+
)
29+
30+
# itkDCMTKFileReader.h transitively #include's dcmtk/dcmdata/*.h. ITKDCMTK
31+
# is a PRIVATE_DEPENDS of ITKIODCMTK (so consumers don't see DCMTK headers),
32+
# but the test driver includes itkDCMTKFileReader.h directly and therefore
33+
# needs the DCMTK include path on its compile line.
34+
# Reconstruct the include path the same way
2635
# Modules/ThirdParty/DCMTK/CMakeLists.txt populates ITKDCMTK_INCLUDE_DIRS,
2736
# since that variable is not in scope here.
2837
if(NOT ITK_USE_SYSTEM_DCMTK)

Modules/IO/IOTransformDCMTK/itk-module.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ itk_module(
1111
ENABLE_SHARED
1212
DEPENDS
1313
ITKIOTransformBase
14+
PRIVATE_DEPENDS
1415
ITKDCMTK
1516
TEST_DEPENDS
1617
ITKIOTransformBase

Modules/IO/IOTransformDCMTK/src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ set(
55
)
66

77
itk_module_add_library(IOTransformDCMTK ${IOTransformDCMTK_SRCS})
8+
9+
# itkDCMTKTransformIO.hxx is a private implementation header in this directory.
10+
target_include_directories(IOTransformDCMTK PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

Modules/IO/IOTransformDCMTK/include/itkDCMTKTransformIO.hxx renamed to Modules/IO/IOTransformDCMTK/src/itkDCMTKTransformIO.hxx

File renamed without changes.

0 commit comments

Comments
 (0)