Skip to content

COMP,BUG: Fix IODCMTK test include paths#6514

Merged
blowekamp merged 2 commits into
InsightSoftwareConsortium:mainfrom
blowekamp:fix_iodcmtk_test
Jun 25, 2026
Merged

COMP,BUG: Fix IODCMTK test include paths#6514
blowekamp merged 2 commits into
InsightSoftwareConsortium:mainfrom
blowekamp:fix_iodcmtk_test

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Fix missing DCMTK include paths for IODCMTK tests and remove stale manual header includes.

Changes
  • itk-module.cmake: Add DCMTK include paths to the test interface so private headers are found without manual paths.
  • test/CMakeLists.txt: Remove incorrect manual include_directories calls that were redundant and stale.
AI assistance

GitHub Copilot assisted with root-cause analysis and commit authoring.

The tests use the private headers, and require DCMTK headers.
These header includes are old and incorrect and the paths are now
implicit with using the interface libraries.
@blowekamp blowekamp marked this pull request as ready for review June 25, 2026 14:48
@blowekamp blowekamp requested a review from hjmjohnson June 25, 2026 14:48
@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:IO Issues affecting the IO module labels Jun 25, 2026
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes missing DCMTK include paths for the ITKIODCMTK test driver by adding ITKDCMTK to TEST_DEPENDS in itk-module.cmake and removing the now-stale manual target_include_directories block that hard-coded paths from the old ExternalProject layout.

  • itk-module.cmake: Adds ITKDCMTK to TEST_DEPENDS so the ITKIODCMTK-Test module links to ITKDCMTKModule, which carries DCMTK include directories transitively — via ITKDCMTK_SYSTEM_INCLUDE_DIRS for the system-DCMTK case, and via the real FetchContent library targets for the bundled case.
  • test/CMakeLists.txt: Removes 54 lines of manual per-library include_directories calls that hard-coded ITKDCMTK_ExtProject paths; those paths no longer exist after the switch from ExternalProject to FetchContent.

Confidence Score: 5/5

Safe to merge — two-line change to module metadata and deletion of stale dead code with no functional risk.

The added TEST_DEPENDS entry is the canonical ITK way to expose a private dependency's headers to the test driver. It works correctly for both the system-DCMTK path (via ITKDCMTK_SYSTEM_INCLUDE_DIRS propagated as SYSTEM INTERFACE dirs on ITKDCMTKModule) and the FetchContent/bundled path (transitive INTERFACE_INCLUDE_DIRECTORIES from the real dcmtk library targets). The removed manual include block targeted ExternalProject paths that no longer exist after the migration to FetchContent, so deleting it cannot regress anything.

No files require special attention.

Important Files Changed

Filename Overview
Modules/IO/DCMTK/itk-module.cmake Adds ITKDCMTK to TEST_DEPENDS — the standard ITK mechanism for propagating a private module dependency's include dirs to the test driver.
Modules/IO/DCMTK/test/CMakeLists.txt Removes stale manual include_directories block that targeted now-nonexistent ExternalProject paths; the remaining src/ include is still correct for the private itkDCMTKFileReader.h header.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ITKIODCMTKTestDriver] -->|links via ITKIODCMTK-Test_LIBRARIES| B[ITKDCMTKModule]
    A -->|explicit src/ path| C[itkDCMTKFileReader.h\nprivate src/ header]
    B -->|INTERFACE links| D["DCMTK::dcmdata\nDCMTK::ofstd\n… INTERFACE IMPORTED"]
    D -->|links to real target| E{Build mode}
    E -->|ITK_USE_SYSTEM_DCMTK=ON| F[System DCMTK\nDCMTK_INCLUDE_DIRS via\nITKDCMTK_SYSTEM_INCLUDE_DIRS]
    E -->|ITK_USE_SYSTEM_DCMTK=OFF| G[FetchContent dcmtk targets\nwith INTERFACE_INCLUDE_DIRECTORIES]
    F -->|SYSTEM INTERFACE propagated| A
    G -->|transitive include dirs| A

    style B fill:#b7e1cd
    style D fill:#b7e1cd
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[ITKIODCMTKTestDriver] -->|links via ITKIODCMTK-Test_LIBRARIES| B[ITKDCMTKModule]
    A -->|explicit src/ path| C[itkDCMTKFileReader.h\nprivate src/ header]
    B -->|INTERFACE links| D["DCMTK::dcmdata\nDCMTK::ofstd\n… INTERFACE IMPORTED"]
    D -->|links to real target| E{Build mode}
    E -->|ITK_USE_SYSTEM_DCMTK=ON| F[System DCMTK\nDCMTK_INCLUDE_DIRS via\nITKDCMTK_SYSTEM_INCLUDE_DIRS]
    E -->|ITK_USE_SYSTEM_DCMTK=OFF| G[FetchContent dcmtk targets\nwith INTERFACE_INCLUDE_DIRECTORIES]
    F -->|SYSTEM INTERFACE propagated| A
    G -->|transitive include dirs| A

    style B fill:#b7e1cd
    style D fill:#b7e1cd
Loading

Reviews (1): Last reviewed commit: "BUG: Remove manual includes in IODCMTK t..." | Re-trigger Greptile

Comment thread Modules/IO/DCMTK/test/CMakeLists.txt
@blowekamp blowekamp merged commit 5573a89 into InsightSoftwareConsortium:main Jun 25, 2026
20 of 22 checks passed
@hjmjohnson

Copy link
Copy Markdown
Member

@blowekamp THANK YOU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants