MSVC_RUNTIME_LIBRARY ignored on command line

I’m trying to build libtiff on Win32 as a static library with static runtime linkage. I can’t seem to get the project to change the runtime library to static. Here’s my commands:

cd g:\devel\libtiff_out
cmake.exe -G "Visual Studio 14 2015" -D BUILD_SHARED_LIBS=OFF -D CMAKE_POLICY_DEFAULT_CMP0091=NEW -D MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" -s g:\devel\libtiff 

At the end I see “CMake Warning: Manually-specified variables were not used by the project: MSVC_RUNTIME_LIBRARY”

The Visual Studio project files still have the DLL version of the runtime libraries selected.

How do I get the setting to apply?

I’m using CMake 3.18. Here’s the doc page on this setting:

The variable CMAKE_MSVC_RUNTIME_LIBRARY can be used to set the target property MSVC_RUNTIME_LIBRARY.

Your command should use CMAKE_MSVC_RUNTIME_LIBRARY.

Thanks, that solved the problem. Is there some documentation that explains the relationship between a command line variable and a target property?

I just search for it in the documentation. Typically if there is a property then there is a variable that sets up any defaults for that property. It might be missed because the documentation for the property doesn’t link back to the variable.

For example the link for CMAKE_MSVC_RUNTIME_LIBRARY states:
Select the MSVC runtime library for use by compilers targeting the MSVC ABI. This variable is used to initialize the MSVC_RUNTIME_LIBRARY property on all targets as they are created. It is also propagated by calls to the try_compile() command into the test project.