COMP: Provide ITK_MSVC_STATIC_CRT to in-tree build#5347
Merged
thewtex merged 1 commit intoInsightSoftwareConsortium:masterfrom May 14, 2025
dg0yt:msvc-crt
Merged
COMP: Provide ITK_MSVC_STATIC_CRT to in-tree build#5347thewtex merged 1 commit intoInsightSoftwareConsortium:masterfrom dg0yt:msvc-crt
thewtex merged 1 commit intoInsightSoftwareConsortium:masterfrom
dg0yt:msvc-crt
Conversation
ITK_MSVC_STATIC_CRT was exported from installed ITKConfig.cmake, but it wasn't available when building external modules (e.g. RTK) together with ITK. This caused linking errors for tools.
There was a problem hiding this comment.
Thank you for contributing a pull request! 🙏
Welcome to the ITK community! 🤗👋☀️
We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
More support and guidance on the contribution process can be found in our contributing guide. 📖
This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment
on it.
dzenanz
approved these changes
May 14, 2025
Member
dzenanz
left a comment
There was a problem hiding this comment.
I would think that this change would have no effect.
thewtex
approved these changes
May 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ITK_MSVC_STATIC_CRTwas exported from installedITKConfig.cmake, butit wasn't available when building external modules (e.g. RTK) together
with ITK. This caused linking errors for tools. This PR is the minimal change to ensure consistent configuration.
ITK_MSVC_STATIC_CRTis used inCMake/ITKModuleExternal.cmakeand inCMake/UseITK.cmake. The external RTK module includes the use file athttps://github.com/RTKConsortium/RTK/blob/d15c02af5d36098b5209e846c0585e70290fe6b7/applications/CMakeLists.txt#L32-L33
and started to use the wrong CRT from this point due to
ITK_MSVC_STATIC_CRTbeing not set.This issue was noticed in CI for the vcpkg port. The previous workaround was passing
-DITK_MSVC_STATIC_CRT=ONto CMake. I don't expect this to be widely used.PR Checklist