There is always another way:
if(CMAKE_BUILD_TYPE MATCHES "release") SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else(CMAKE_BUILD_TYPE MATCHES "debug") SET(CMAKE_BUILD_TYPE "debug") endif(CMAKE_BUILD_TYPE MATCHES "release")
We can use the variable CMAKE_BUILD_TYPE. We can also change this variable at the start of a CMAKE call:
cmake .. -DCMAKE_BUILD_TYPE:STRING=debug
Then we can use this variable as an indicator of the assembly configuration.
source share