diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da86f15..62b51c44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,13 +125,19 @@ if (_GLFW_WIN32) option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON) if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL) - foreach (flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) + foreach (flag CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO) + if (${flag} MATCHES "/MD") string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}") endif() if (${flag} MATCHES "/MDd") string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}") endif() + endforeach() endif() endif()