[CMake] Setting COMPILE_FLAGS property on a target in only debug?

Stephen Kelly steveire at gmail.com
Mon May 7 17:51:03 EDT 2012


Andreas Mohr wrote:
> I'd like to add one more dimension to it:

Thanks for the review.

> I'd think that Debug/Release isn't all that matters -
> what discussions all too conveniently leave out (possibly even the KDE
> Wiki-side target config discussion!) is platform-specific handling,
> too (Win32 / Win64 / cross-compiles / ...).
> After all, a full build declaration is "x64/Release", not merely
> "Release". 

But what is the CMAKE_BUILD_TYPE in this case? Also, how do you deal with 
these platform issues (Win32 / Win64 / cross-compiles / ...) currently?

> And for the sometimes desired per-configuration-type
> (**dynamic**) way of handling this CMake currently doesn't have much (if
> any) support. 

I'm not sure what this means. (Keep in mind that I have only ever used the 
UnixMakefiles and Ninja generators).

Do you mean you want to run cmake once and then build multiple 
configurations (at the same time?)?

Instead of what I do which would be 

mkdir debug && cd debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
mkdir ../release && cd ../release
cmake .. -DCMAKE_BUILD_TYPE=Release
make

You want to build debug and release at the same time?

Thanks,

Steve.




More information about the CMake mailing list