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

Vyacheslav Karamov ubuntulist at yandex.ru
Sat May 5 03:52:28 EDT 2012


Hi!

It's pity, but CMAKE_BUILD_TYPE is empty for CMake Visual Studio generator.

04.05.2012 23:40, Tim Gallagher ???????:
> Put an:
>
> if(CMAKE_BUILD_TYPE STREQUAL "Debug")
> endif()
>
> guard around the set_property call.
>
> Tim
>
> ------------------------------------------------------------------------
> *From: *"Robert Dailey" <rcdailey.lists at gmail.com>
> *To: *"CMake ML" <cmake at cmake.org>
> *Sent: *Friday, May 4, 2012 4:16:47 PM
> *Subject: *[CMake] Setting COMPILE_FLAGS property on a target in only 
> debug?
>
> 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?
>
> --
>
> 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
>
>
>
> --
>
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120505/ffe8a1a5/attachment.htm>


More information about the CMake mailing list