COMP: IO modules publicly depend on ImageIOBase#6070
Conversation
DCMTK, GE, LSM, and PhilipsREC have public headers that #include itkImageIOBase.h or inherit from ImageIOBase, making ITKIOImageBase a genuine public dependency. Move it from PRIVATE_DEPENDS to DEPENDS so downstream consumers receive the transitive include paths and link targets. Follows the same pattern as the VTK fix in PR InsightSoftwareConsortium#5850.
|
| Filename | Overview |
|---|---|
| Modules/IO/DCMTK/itk-module.cmake | Moves ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS; confirmed by itkDCMTKImageIO.h, itkDCMTKImageIOFactory.h, and itkDCMTKFileReader.h all including itkImageIOBase.h |
| Modules/IO/GE/itk-module.cmake | Moves ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS and removes now-empty PRIVATE_DEPENDS block; confirmed by itkGE4ImageIOFactory.h, itkGE5ImageIOFactory.h, and itkGEAdwImageIOFactory.h including itkImageIOBase.h |
| Modules/IO/LSM/itk-module.cmake | Moves ITKIOImageBase from PRIVATE_DEPENDS to DEPENDS; ENABLE_SHARED between DEPENDS and PRIVATE_DEPENDS is valid per the custom itk_module() parser which resets _doing="" on ENABLE_SHARED |
| Modules/IO/PhilipsREC/itk-module.cmake | Moves ITKIOImageBase from PRIVATE_DEPENDS to new DEPENDS block; confirmed by itkPhilipsRECImageIO.h and itkPhilipsRECImageIOFactory.h including itkImageIOBase.h |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before["Before (PRIVATE_DEPENDS)"]
A1[ITKIODCMTK] -->|PRIVATE| B[ITKIOImageBase]
A2[ITKIOGE] -->|PRIVATE| B
A3[ITKIOLSM] -->|PRIVATE| B
A4[ITKIOPhilipsREC] -->|PRIVATE| B
end
subgraph After["After (DEPENDS)"]
C1[ITKIODCMTK] -->|PUBLIC| D[ITKIOImageBase]
C2[ITKIOGE] -->|PUBLIC| D
C3[ITKIOLSM] -->|PUBLIC| D
C4[ITKIOPhilipsREC] -->|PUBLIC| D
end
subgraph Downstream["Downstream Consumer"]
E[User Module] -->|depends on| C1
C1 -->|transitive PUBLIC| D
D -->|include paths + link targets| E
end
Reviews (3): Last reviewed commit: "COMP: IO modules publicly depend on Imag..." | Re-trigger Greptile
|
/azp run ITK.Windows |
|
@blowekamp This is an extension of your recent work. I don't fully understand all the implications of this change, but it 'smells' right. The analysis makes sense to me as well. |
blowekamp
left a comment
There was a problem hiding this comment.
Likely fine. As I recall this was discovered in v6 with the testing directories strictly using the target based includes replaced the directory/module wide includes.
c5aef06
into
InsightSoftwareConsortium:main
Move
ITKIOImageBasefromPRIVATE_DEPENDStoDEPENDSfor 4 IO modules whose public headers#include "itkImageIOBase.h"or inherit fromImageIOBase: DCMTK, GE, LSM, and the Philips REC module.Follows the same fix applied to VTK in #5850. With
PRIVATE_DEPENDS, downstream projects that consume these modules' public headers may not receive the transitive include paths and link targets forITKIOImageBase.Header analysis confirming public dependency
Each module was verified to have public headers that directly reference ITKIOImageBase types:
itkDCMTKImageIO.hincludesitkImageIOBase.h,DCMTKImageIOinherits fromImageIOBaseitkGE4ImageIOFactory.h,itkGE5ImageIOFactory.h,itkGEAdwImageIOFactory.hincludeitkImageIOBase.hitkLSMImageIOFactory.hincludesitkImageIOBase.hitkPhilipsRECImageIO.hincludesitkImageIOBase.h, inherits fromImageIOBaseNot included: ITKIOCSV — its public headers do not reference any IOImageBase types. Its
PRIVATE_DEPENDS ITKIOImageBasemay be vestigial or only needed for module infrastructure, and warrants separate investigation.Local build verification
EXCLUDE_FROM_DEFAULT)ITKIOImageBaseappears inPUBLIC_DEPENDSandTRANSITIVE_DEPENDS