remove_definitions.rst 714 B

1234567891011121314151617181920212223242526272829303132
  1. remove_definitions
  2. ------------------
  3. Removes compile definitions added by :command:`add_compile_definitions`, or
  4. :command:`add_definitions`:
  5. .. code-block:: cmake
  6. remove_definitions([<definitions>...])
  7. The arguments are:
  8. ``<definitions>...``
  9. Zero or more compile definitions.
  10. This command can be also used to remove any flags added by
  11. :command:`add_definitions`, but it is intended to remove preprocessor
  12. definitions passed with ``-D``, or ``/D``.
  13. Examples
  14. ^^^^^^^^
  15. In the following example targets of the current directory scope will have
  16. only ``BAZ`` and ``QUUX`` compile definitions:
  17. .. code-block:: cmake
  18. add_compile_definitions(FOO BAR BAZ -DQUUX)
  19. # ...
  20. remove_definitions(-DFOO -DBAR)