Problem with CMAKE_CXX_FLAGS_DEBUG on newer version
Hello! Can you help me with the following problem:
- my cmake version is 3.17.5
- my project contains
cmake_minimum_required(VERSION 3.13)
- I'm using Visual Studio 16 2019 on windows
- my project uses some libs built with /MD, and to avoid linker errors I sometime build it with
-DCMAKE_CXX_FLAGS_DEBUG="/MD"
(because vs default is MDd for debug builds) - now I've started to use OBJECT lib targets and incremented my version (because 3.13 does not have soe useful features for treating OBJECT targets and is not supported anymore) - I've set
cmake_minimum_required(VERSION 3.15.3)
- for some reason
-DCMAKE_CXX_FLAGS_DEBUG="/MD"
stop working (looks like it is ignored)
Note, that I did not change actual cmake's version during experiment and did not see any policy warnings. Can you please explain the reason of the problem shortly and how can it be solved (I'd like to set some flag on command line during cmake's invocation instead of using any other configuration methods).