[CMake] Append to property COMPILE_DEFINITIONS

Petr Kmoch petr.kmoch at gmail.com
Fri Aug 11 09:10:02 EDT 2017


On 24 July 2017 at 04:32, Florian Lindner <mailinglists at xgm.de> wrote:

>
>
> [snip]
>
> Still, I don't undertand what is wrong with:
>
> set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS
> $<$<CONFIG:Debug>:-FOO>)
>
> ?
>

What's wrong is that there is no such global property. See the list of
global properties:
https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#properties-of-global-scope

COMPILE_DEFINITIONS is not among them.

You're therefore effectively creating a new user-defined global property,
which of course has no effect on CMake's behaviour.

Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170811/5fbce9c7/attachment.html>


More information about the CMake mailing list