From b1dbb79d7a3a63a3ce1205b5cce3984fb78a8d74 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 14 May 2025 08:14:42 +0200 Subject: [PATCH] COMP: Provide ITK_MSVC_STATIC_CRT to in-tree build 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. --- CMake/ITKConfig.cmake.in | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMake/ITKConfig.cmake.in b/CMake/ITKConfig.cmake.in index 2286442eb03..facc51c6572 100644 --- a/CMake/ITKConfig.cmake.in +++ b/CMake/ITKConfig.cmake.in @@ -48,7 +48,7 @@ set(ITK_BUILD_SHARED "@ITK_BUILD_SHARED_LIBS@") set(ITK_LIBRARY_BUILD_TYPE "@ITK_LIBRARY_BUILD_TYPE@") # Whether ITK links to MSVC's static CRT (/MT and /MTd). -set(ITK_MSVC_STATIC_CRT "@ITK_MSVC_STATIC_RUNTIME_LIBRARY_value@") +set(ITK_MSVC_STATIC_CRT "@ITK_MSVC_STATIC_CRT@") # Whether ITK examples were built. set(ITK_BUILD_EXAMPLES "@BUILD_EXAMPLES@") diff --git a/CMakeLists.txt b/CMakeLists.txt index 67f79fcbcfb..02c05c71cd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,7 @@ if(MSVC) #-- Configure MSVC_STATIC_RUNTIME only if using MSVC environment option(ITK_MSVC_STATIC_RUNTIME_LIBRARY "Link to MSVC's static CRT (/MT and /MTd). OFF (default) means link to regular, dynamic CRT (/MD and /MDd)." OFF) mark_as_advanced(ITK_MSVC_STATIC_RUNTIME_LIBRARY) - set(ITK_MSVC_STATIC_RUNTIME_LIBRARY_value ${ITK_MSVC_STATIC_RUNTIME_LIBRARY}) + set(ITK_MSVC_STATIC_CRT ${ITK_MSVC_STATIC_RUNTIME_LIBRARY}) if(ITK_MSVC_STATIC_RUNTIME_LIBRARY) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") message(STATUS "Using MSVC's static CRT (/MT and /MTd)")