ENH: Add example project which used ITK Modules and FetchContent#5740
ENH: Add example project which used ITK Modules and FetchContent#5740blowekamp wants to merge 1 commit intoInsightSoftwareConsortium:mainfrom
Conversation
hjmjohnson
left a comment
There was a problem hiding this comment.
@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.
@blowekamp This should probably default to InsightSoftwareConsortium rather than blowekamp organization.
There was a problem hiding this comment.
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.
OK for DRAFT pr, but should this default to "main" or "v5.4.5" or "latest"? as the default?
There was a problem hiding this comment.
At least during development, it may be best to use a variable that points to the current git hash... This may get tricky with source distributions and keeping this directory independent of the ITK CMAkE environment.
So...likely "main" is the best option.
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.
65b38b2 to
f8c35f0
Compare
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.