mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
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.
This commit is contained in:
committed by
Brad King
parent
5831b6a2ae
commit
3af1daa186
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user