summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-19 14:58:55 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-19 14:59:02 (GMT)
commit8866f63f60a46f947fb9a6658944988da84867c4 (patch)
treef35c63c2ba0cd163399c287a652657e7b2845a8e /Help/command
parentb7b2ce56a7f215574144da390b803611b9e5eca1 (diff)
parentb82526c6542afbaea7e315cc4628cacdfe90ebae (diff)
downloadCMake-8866f63f60a46f947fb9a6658944988da84867c4.zip
CMake-8866f63f60a46f947fb9a6658944988da84867c4.tar.gz
CMake-8866f63f60a46f947fb9a6658944988da84867c4.tar.bz2
Merge topic 'macro_doc_cleanups'
b82526c654 Help: Minor grammar and typo corrections for macro command docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2622
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/macro.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Help/command/macro.rst b/Help/command/macro.rst
index 42a99fc..464940f 100644
--- a/Help/command/macro.rst
+++ b/Help/command/macro.rst
@@ -76,16 +76,16 @@ Macro vs Function
The ``macro`` command is very similar to the :command:`function` command.
Nonetheless, there are a few important differences.
-In a function, ``ARGC``, ``ARGC`` and ``ARGV0``, ``ARGV1``, ... are
-true variables in the usual CMake sense. In a macro, they are not.
-They are string replacements much like the C preprocessor would do
+In a function, ``ARGN``, ``ARGC``, ``ARGV`` and ``ARGV0``, ``ARGV1``, ...
+are true variables in the usual CMake sense. In a macro, they are not,
+they are string replacements much like the C preprocessor would do
with a macro. This has a number of consequences, as explained in
the :ref:`Argument Caveats` section below.
Another difference between macros and functions is the control flow.
A function is executed by transfering control from the calling
statement to the function body. A macro is executed as if the macro
-body were pasted in place of the calling statement. This has for
+body were pasted in place of the calling statement. This has the
consequence that a :command:`return()` in a macro body does not
just terminate execution of the macro; rather, control is returned
from the scope of the macro call. To avoid confusion, it is recommended
@@ -96,7 +96,7 @@ to avoid :command:`return()` in macros altogether.
Argument Caveats
^^^^^^^^^^^^^^^^
-Since ``ARGC``, ``ARGC``, ``ARGV0`` etc are not variables,
+Since ``ARGN``, ``ARGC``, ``ARGV``, ``ARGV0`` etc. are not variables,
you will NOT be able to use commands like
.. code-block:: cmake