1CMAKE_MSVC_RUNTIME_LIBRARY 2-------------------------- 3 4.. versionadded:: 3.15 5 6Select the MSVC runtime library for use by compilers targeting the MSVC ABI. 7This variable is used to initialize the :prop_tgt:`MSVC_RUNTIME_LIBRARY` 8property on all targets as they are created. It is also propagated by 9calls to the :command:`try_compile` command into the test project. 10 11The allowed values are: 12 13.. include:: ../prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt 14 15Use :manual:`generator expressions <cmake-generator-expressions(7)>` to 16support per-configuration specification. For example, the code: 17 18.. code-block:: cmake 19 20 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") 21 22selects for all following targets a multi-threaded statically-linked runtime 23library with or without debug information depending on the configuration. 24 25If this variable is not set then the :prop_tgt:`MSVC_RUNTIME_LIBRARY` target 26property will not be set automatically. If that property is not set then 27CMake uses the default value ``MultiThreaded$<$<CONFIG:Debug>:Debug>DLL`` 28to select a MSVC runtime library. 29 30.. note:: 31 32 This variable has effect only when policy :policy:`CMP0091` is set to ``NEW`` 33 prior to the first :command:`project` or :command:`enable_language` command 34 that enables a language using a compiler targeting the MSVC ABI. 35