[CMake] select debug or optimized at make time instead of at cmake time

Richard Fuchs fuchsrich at se-core.net
Fri Oct 6 09:13:38 EDT 2006


Is there a way to be able to select if the build will be debug or 
optimized at make time instead of during cmake time?

So, I can SET(CMAKE_BUILD_TYPE Debug) or SET(CMAKE_BUILD_TYPE Release) 
for debug or optimized code respectively, then when I run make, the 
corresponding compiler flags are set.  What I'd like to be able to do is 
have it so that when I run 'make', it uses debug flags and when a run 
something like 'make release', it'll use the optimize flags.  Is 
something like this possible?

Thanks
Richard


More information about the CMake mailing list