remove_definitions
Removes compile definitions added by add_compile_definitions(), or add_definitions():
remove_definitions([<definitions>...])
The arguments are:
-
<definitions>... -
Zero or more compile definitions.
This command can be also used to remove any flags added by 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:
add_compile_definitions(FOO BAR BAZ -DQUUX) # ... remove_definitions(-DFOO -DBAR)
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/command/remove_definitions.html