mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 14:50:10 -06:00
remove_definitions: Update documentation
- Reworded command description. - Briefly mentioned that this command can also remove other flags given by add_definitions(). - Added examples section. - Mentioned also add_compile_definitions() command, as remove_definitions() can remove also those.
This commit is contained in:
@@ -1,11 +1,32 @@
|
||||
remove_definitions
|
||||
------------------
|
||||
|
||||
Remove -D define flags added by :command:`add_definitions`.
|
||||
Removes compile definitions added by :command:`add_compile_definitions`, or
|
||||
:command:`add_definitions`:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
remove_definitions(-DFOO -DBAR ...)
|
||||
remove_definitions([<definitions>...])
|
||||
|
||||
Removes flags (added by :command:`add_definitions`) from the compiler
|
||||
command line for sources in the current directory and below.
|
||||
The arguments are:
|
||||
|
||||
``<definitions>...``
|
||||
Zero or more compile definitions.
|
||||
|
||||
This command can be also used to remove any flags added by
|
||||
:command:`add_definitions`, but it is intended to remove preprocessor
|
||||
definitions passed with ``-D``, or ``/D``.
|
||||
|
||||
Examples
|
||||
^^^^^^^^
|
||||
|
||||
In the following example targets of the current directory scope will have
|
||||
only ``BAZ`` and ``QUUX`` compile definitions:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
add_compile_definitions(FOO BAR BAZ -DQUUX)
|
||||
|
||||
# ...
|
||||
|
||||
remove_definitions(-DFOO -DBAR)
|
||||
|
||||
Reference in New Issue
Block a user