Skip to content

COMP: Link ITK::ITKVtkGlueModule in examples that include QuickView.h - #478

Draft
hjmjohnson wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:comp-quickview-link-vtkglue
Draft

COMP: Link ITK::ITKVtkGlueModule in examples that include QuickView.h#478
hjmjohnson wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:comp-quickview-link-vtkglue

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Forty-nine of the fifty examples that #include "QuickView.h" never linked ITK::ITKVtkGlueModule, the module that provides that header, so the build fails with fatal error: 'QuickView.h' file not found whenever VTK is present. One line added per example; no other changes.

Why this is not visible in a normal build

src/CMakeLists.txt sets ENABLE_QUICKVIEW and add_definitions(-DENABLE_QUICKVIEW) only when VTK is found. Every affected Code.cxx guards the include:

#ifdef ENABLE_QUICKVIEW
#  include "QuickView.h"
#endif

Without VTK the include is compiled out and the missing link is harmless. With VTK the include fires, but because the target never links ITK::ITKVtkGlueModule, that module's include directory is absent from the compile line:

Code.cxx:23:12: fatal error: 'QuickView.h' file not found
   23 | #include "QuickView.h"
      |          ^~~~~~~~~~~~~

Bridge/VtkGlue/VTKImageToITKImage was the single example already linking the module, and supplied the spelling used throughout this change.

Shape of the change

Pure insertions — 49 files, one identical line each, nothing removed:

  • 45 examples have a guarded if(ENABLE_QUICKVIEW) link block; the entry is added beside ${VTK_LIBRARIES}.
  • 4 examples link unconditionally; the entry is added to that single block.

pre-commit run --all-files passes, gersemi included, so the additions match the project's CMake formatting.

How it was found and verified

Surfaced by a downstream build testbed that builds ITKSphinxExamples against a locally built ITK with VTK available, so ENABLE_QUICKVIEW is on. Before the change the build stopped in src/Core/Common/IterateLineThroughImage and two sibling examples; after it, the suite configures and builds through to its test phase.

Verified against ITK main with Module_ITKVtkGlue=ON.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S5zzoU6yyUwdLEvjM2s6iS

Fifty examples include "QuickView.h" under #ifdef ENABLE_QUICKVIEW, but
forty-nine never linked ITK::ITKVtkGlueModule, the module that provides
that header. Its include directory therefore never reached the compile
line and the build failed with:

    Code.cxx:23:12: fatal error: 'QuickView.h' file not found

src/CMakeLists.txt defines ENABLE_QUICKVIEW only when VTK is found, so a
configure without VTK compiles the guarded include out and the omission
is invisible. It appears only in a build that has VTK available.

Bridge/VtkGlue/VTKImageToITKImage already linked the module and supplied
the spelling used here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S5zzoU6yyUwdLEvjM2s6iS
@github-actions github-actions Bot added area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Segmentation Issues affecting the Segmentation module type:Compiler Compiler support or related warnings type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Nonunit Issues affecting the Nonunit module labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Nonunit Issues affecting the Nonunit module area:Segmentation Issues affecting the Segmentation module type:Compiler Compiler support or related warnings 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