diff options
author | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2018-03-20 14:13:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-20 18:06:15 (GMT) |
commit | 3af1daa186f01f1538cf9a7541e9269ac0c6e95a (patch) | |
tree | 5a95ea6dcc3e7dc0cfd2f3a62b9bac3b8a42ba6b /Help/command | |
parent | 5831b6a2aec74cd9d1d10b1d047da8fa0411c828 (diff) | |
download | CMake-3af1daa186f01f1538cf9a7541e9269ac0c6e95a.zip CMake-3af1daa186f01f1538cf9a7541e9269ac0c6e95a.tar.gz CMake-3af1daa186f01f1538cf9a7541e9269ac0c6e95a.tar.bz2 |
Help: Document target_compile_definitions handling of -D
Add an example of using the `target_compile_definitions` command and a
note about usage of ``-D`` in items.
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/target_compile_definitions.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst index 3709e7a..a740117 100644 --- a/Help/command/target_compile_definitions.rst +++ b/Help/command/target_compile_definitions.rst @@ -27,3 +27,13 @@ Arguments to ``target_compile_definitions`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +Any leading ``-D`` on an item will be removed. Empty items are ignored. +For example, the following are all equivalent: + +.. code-block:: cmake + + target_compile_definitions(foo PUBLIC FOO) + target_compile_definitions(foo PUBLIC -DFOO) # -D removed + target_compile_definitions(foo PUBLIC "" FOO) # "" ignored + target_compile_definitions(foo PUBLIC -D FOO) # -D becomes "", then ignored |