msvc_runtime.cmake 486 B

123456789101112131415
  1. cmake_minimum_required(VERSION 3.2)
  2. if (MSVC)
  3. # Use statically linked versions of the MS standard libraries.
  4. if (NOT "${MSVC_RUNTIME}" STREQUAL "dll")
  5. foreach (flag_var
  6. CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
  7. CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
  8. if (${flag_var} MATCHES "/MD")
  9. string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
  10. endif ()
  11. endforeach ()
  12. endif ()
  13. endif ()