about summary refs log tree commit diff
path: root/cmake/SelectMSVCRuntime.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/SelectMSVCRuntime.cmake')
-rw-r--r--cmake/SelectMSVCRuntime.cmake13
1 files changed, 3 insertions, 10 deletions
diff --git a/cmake/SelectMSVCRuntime.cmake b/cmake/SelectMSVCRuntime.cmake
index eb7f8f9e954b..feb2fe46c381 100644
--- a/cmake/SelectMSVCRuntime.cmake
+++ b/cmake/SelectMSVCRuntime.cmake
@@ -29,17 +29,10 @@
 #
 if (MSVC AND VCPKG_TARGET_TRIPLET MATCHES "-static$")
     foreach (flag_var
-             CMAKE_CXX_FLAGS
-             CMAKE_CXX_FLAGS_DEBUG
-             CMAKE_CXX_FLAGS_RELEASE
-             CMAKE_CXX_FLAGS_MINSIZEREL
-             CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
         if (${flag_var} MATCHES "/MD")
-            string(REGEX
-                   REPLACE "/MD"
-                           "/MT"
-                           ${flag_var}
-                           "${${flag_var}}")
+            string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
         endif ()
     endforeach (flag_var)
     unset(flag_var)