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

Robert Dailey rcdailey.lists at gmail.com
Mon May 7 11:37:41 EDT 2012


On Sat, May 5, 2012 at 5:34 AM, Michael Wild <themiwi at gmail.com> wrote:

> On 05/04/2012 10:16 PM, Robert Dailey wrote:
> > I'm doing the following:
> >
> > set_property( TARGET ${target_name} APPEND_STRING PROPERTY
> > COMPILE_FLAGS "/ZI /Gy "
> > )
> >
> > However this applies to all configurations. I want to only set this
> > compiler flag for debug builds, not release. How can I do this?
> >
>
> Can you misuse the COMPILE_DEFINITIONS_DEBUG property? Should work, IMHO.


I can try it as a hack/workaround, but I would prefer to use the "right
tool for the job". Perhaps this would make a good feature request. I
definitely need this to work for Visual Studio, so I can't assume the build
configuration is known at generation time in CMake.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120507/13fd8e6a/attachment-0001.htm>


More information about the CMake mailing list