Hi,
In CMake, some options (like CMAKE_OSX_ARCHITECTURES), should be set before the first “project()” command, which is pretty clear.
But, I need a somehow similar option, CMAKE_MSVC_RUNTIME_LIBRARY, and I want to be 100% sure that I understand the documentation correctly.
The documentation states that:
This variable has effect only when policy CMP0091 is set to NEW prior to the first project() or enable_language() command that enables a language using a compiler targeting the MSVC ABI.
And then about the policy:
This policy was introduced in CMake version 3.15. It may be set by cmake_policy() or cmake_minimum_required(). If it is not set, CMake does not warn, and uses OLD behavior.
So my question is: is the following code correct, or should I do something else before using “project()” command?
cmake_minimum_required(VERSION 3.15)
project(test C CXX)
set(CMAKE_MSVC_RUNTIME_LIBRARY “MultiThreaded$<$CONFIG:Debug:Debug>”)
Thank you