COMP: Provide ITK_MSVC_STATIC_CRT to in-tree build #5347
Merged
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