It seems that CMAKE_BUILD_TYPE cannot be evaluated when using the CodeBlocks IDE ?

In what way? Does the variable not work for some reason? Do you have an example with expected and actual output?

It doesnt work. It evaluates to an empty string. CodeBlocks version is 20.03

The default value might be the empty string (it depends on the generator). Usually this ends up being treated as Debug, but I recommend adding logic to set the value if you’re in a single-config generator and it is an empty string.