It would certainly be nice if cmake allowed it, but you could use James' suggestion if cmake provides some sort of predefined symbol that allows buil switching -- does it? e.g. #ifdef CMAKE_BUILD_RELWITHDEBINFO ...