cmake ignores -D CMAKE_BUILD_TYPE=Debug
问题 I'm just trying to build a cmake project in debug-mode to enable asserts. I tried the following versions: cmake -D CMAKE_BUILD_TYPE:STRING=Debug -L ../../ cmake -DCMAKE_BUILD_TYPE:STRING=Debug -L ../../ cmake -DCMAKE_BUILD_TYPE=Debug -L ../../ Unfortunately none of theese has the desired effect - that CMAKE_BUILD_TYPE is set to Debug (and therefore the NDEBUG -flag is not passed to gcc). Additionally I added variable_watch(CMAKE_BUILD_TYPE) to my main CMakeLists.txt to check whether the value