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

David Cole david.cole at kitware.com
Mon May 7 18:10:09 EDT 2012


On Mon, May 7, 2012 at 5:51 PM, Stephen Kelly <steveire at gmail.com> wrote:
> 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.
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


People configure once with CMake, and then build Release and Debug in
the same build tree with Visual Studio and Xcode generators all the
time.

That's just the way that multi-configuration generators work.


More information about the CMake mailing list