summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-01 14:28:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-12-01 14:30:50 (GMT)
commitee4310c3d9a5a0fb1b99341e50759645f1b83812 (patch)
tree13ebfd957e2bdf849a8903e1d9507aebb75e1fc2 /Help
parent97adf4ce1ae8725a42512e80b99a3069fa488a9e (diff)
parent4b9fcadc9a923ce626ea57a6becf87d218418c8b (diff)
downloadCMake-ee4310c3d9a5a0fb1b99341e50759645f1b83812.zip
CMake-ee4310c3d9a5a0fb1b99341e50759645f1b83812.tar.gz
CMake-ee4310c3d9a5a0fb1b99341e50759645f1b83812.tar.bz2
Merge topic 'compile_def_doc'
4b9fcadc9a Help: Describe definition values in target_compile_definitions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5547
Diffstat (limited to 'Help')
-rw-r--r--Help/command/target_compile_definitions.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 09e2ded..3fb113a 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -39,3 +39,12 @@ For example, the following are all equivalent:
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
+
+Definitions may optionally have values:
+
+.. code-block:: cmake
+
+ target_compile_definitions(foo PUBLIC FOO=1)
+
+Note that many compilers treat ``-DFOO`` as equivalent to ``-DFOO=1``, but
+other tools may not recognize this in all circumstances (e.g. IntelliSense).