I find it quite sensible.
Therefore, I thought I will just use this in my own project.
However, I realized quickly that defining that variable when using another generator than “Ninja Multi-Config” (e.g. “Ninja”) results in CMake failing with a hard error:
CMake Error: Generator Ninja does not support variable CMAKE_DEFAULT_BUILD_TYPE but it has been specified.
I would not mind if this would be an
AUTHOR_WARNING that I could disable with
-Wno-dev. However, this is a hard error and too much baby-sitting. (I know what I did here.)
I suggest removing this error and even extend the usage of
CMAKE_DEFAULT_BUILD_TYPE to what @craig.scott suggested.