Skip to content

Conversation

@blowekamp
Copy link
Member

This is a standalone directly that can be build separately to try out this combination of feature to build a project/executable with ITK.

By use FetchContent for ITK, along with specific ITK module interface library linking enable to build only the targets needed in ITK for a project. While the initial configuration time is longer due to downloading and configuring ITK, the CMake project structure is simpler than a Superbuild, and the build is more efficient.

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.

By use FetchContent for ITK, along with specific ITK module interface
library linking enable to build only the targets needed in ITK for a
project. While the initial configuration time is longer due to
downloading and configuring ITK, the CMake project structure is
simpler than a Superbuild, and the build is more efficient.
@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation area:Examples Demonstration of the use of classes labels Jan 23, 2026
Copy link
Member

@hjmjohnson hjmjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blowekamp This looks like a good example to have.

include(FetchContent)

# Set ITK Git repository and tag
set(ITK_GIT_REPOSITORY "https://github.com/blowekamp/ITK.git")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blowekamp This should probably default to InsightSoftwareConsortium rather than blowekamp organization.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is dependent PR #5721 for the modular interface libraries.

# Set ITK Git repository and tag
set(ITK_GIT_REPOSITORY "https://github.com/blowekamp/ITK.git")

set(ITK_GIT_TAG "cmake_interface_module")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for DRAFT pr, but should this default to "main" or "v5.4.5" or "latest"? as the default?

Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on a glance.

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

Labels

area:Examples Demonstration of the use of classes type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants