-
-
Notifications
You must be signed in to change notification settings - Fork 717
ENH: Add example project which used ITK Modules and FetchContent #5740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
hjmjohnson
left a comment
There was a problem hiding this 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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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?
dzenanz
left a comment
There was a problem hiding this 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.
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
Refer to the ITK Software Guide for
further development details if necessary.