if (MSVC)
  string (REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  string (REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG
                  "${CMAKE_CXX_FLAGS_DEBUG}")
  string (REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL
                  "${CMAKE_CXX_FLAGS_MINSIZEREL}")
  string (REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE
                  "${CMAKE_CXX_FLAGS_RELEASE}")
  string (REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO
                  "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif ()
