MSVC static runtime option /MT is overwritten by /MD

Hello, VTK developers

When building the latest version of VTK
(Commit: 318abc9fda820b3c1619a13008182c84d09ae5b6)
MSVC static runtime option /MT was overwritten by /MD.

This issue is not observed for VTK 9.0.1 released yesterday (2020/06/25).

I used the following build options:

cmake %SOURCE_DIR% -G "Visual Studio 15 2017" ^
 -A x64 ^

The basic environments are

CMake version: 3.18.0-rc2
OS: Windows 10.0.18363
Compiler:  MSVC 19.16.27041.0 (VS 2017, 15.9 update)

I want to build VTK with static linkage to MSVC runtime.
Is there any workaround for this issue?

Thanks in advance.

With newer CMake, you should use CMAKE_MSVC_RUNTIME_LIBRARY instead of manual flags.

1 Like

Hello, Ben

It works!
Thank you so much for your help.