diff options
author | Nikita Nemkin <nikita@nemkin.ru> | 2020-11-07 20:30:30 (GMT) |
---|---|---|
committer | Nikita Nemkin <nikita@nemkin.ru> | 2020-11-09 15:51:57 (GMT) |
commit | c705279bae45c85b689febd66d5437d9ec05c9b9 (patch) | |
tree | f64bca14f17a902a96d67a30357df3d1e6c745eb /Help/command/cmake_parse_arguments.rst | |
parent | 63a1917d098922b59bbba8fdeb42519363d5ba0d (diff) | |
download | CMake-c705279bae45c85b689febd66d5437d9ec05c9b9.zip CMake-c705279bae45c85b689febd66d5437d9ec05c9b9.tar.gz CMake-c705279bae45c85b689febd66d5437d9ec05c9b9.tar.bz2 |
Help: Add `.. versionadded` directives to commands documentation
This change ony concerns directives that appear in the document body.
The guidelines for inserting version directives:
* Baseline version is CMake 3.0, i.e. directives start at 3.1.
* Always use `.. versionadded::` directive, avoid ad-hoc version
references. Exception: policy pages.
* For new command signatures, put `versionadded` on a separate line
after the signature.
* For a group of new signatures in a new document section,
a single version note at the beginning of the section is sufficient.
* For new options, put `versionadded` on a separate line before
option description.
* If all the option descriptions in the list are short one-liners,
it's fine to put `versionadded` on the same line as the description.
* If multiple option descriptions in close proximity would have
the same ..versionadded directive, consider adding a single
directive after the list, mentioning all added options.
* For compact value lists and sub-option lists, put a single
`versionadded` directive after the list mentioning all additions.
* When a change is described in a single paragraph, put
`versionadded` into that paragraph.
* When only part of the paragraph has changed, separate the changed
part if it doesn't break the flow. Otherwise, write a follow-up
clarification paragraph and apply version directive to that.
* When multiple version directives are close by, order earlier
additions before later additions.
* Indent related lists and code blocks to include them in the scope
of `versionadded` directive.
Issue: #19715
Diffstat (limited to 'Help/command/cmake_parse_arguments.rst')
-rw-r--r-- | Help/command/cmake_parse_arguments.rst | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst index 8803ec8..824b7dd 100644 --- a/Help/command/cmake_parse_arguments.rst +++ b/Help/command/cmake_parse_arguments.rst @@ -21,11 +21,12 @@ respective options. The first signature reads processes arguments passed in the ``<args>...``. This may be used in either a :command:`macro` or a :command:`function`. -The ``PARSE_ARGV`` signature is only for use in a :command:`function` -body. In this case the arguments that are parsed come from the -``ARGV#`` variables of the calling function. The parsing starts with -the ``<N>``-th argument, where ``<N>`` is an unsigned integer. This allows for -the values to have special characters like ``;`` in them. +.. versionadded:: 3.7 + The ``PARSE_ARGV`` signature is only for use in a :command:`function` + body. In this case the arguments that are parsed come from the + ``ARGV#`` variables of the calling function. The parsing starts with + the ``<N>``-th argument, where ``<N>`` is an unsigned integer. + This allows for the values to have special characters like ``;`` in them. The ``<options>`` argument contains all options for the respective macro, i.e. keywords which can be used when calling the macro without any value @@ -40,12 +41,11 @@ The ``<multi_value_keywords>`` argument contains all keywords for this macro which can be followed by more than one value, like e.g. the ``TARGETS`` or ``FILES`` keywords of the :command:`install` command. -.. note:: - - All keywords shall be unique. I.e. every keyword shall only be specified - once in either ``<options>``, ``<one_value_keywords>`` or - ``<multi_value_keywords>``. A warning will be emitted if uniqueness is - violated. +.. versionadded:: 3.5 + All keywords shall be unique. I.e. every keyword shall only be specified + once in either ``<options>``, ``<one_value_keywords>`` or + ``<multi_value_keywords>``. A warning will be emitted if uniqueness is + violated. When done, ``cmake_parse_arguments`` will consider for each of the keywords listed in ``<options>``, ``<one_value_keywords>`` and @@ -61,10 +61,12 @@ All remaining arguments are collected in a variable were recognized. This can be checked afterwards to see whether your macro was called with unrecognized parameters. -``<one_value_keywords>`` and ``<multi_value_keywords>`` that were given no -values at all are collected in a variable ``<prefix>_KEYWORDS_MISSING_VALUES`` -that will be undefined if all keywords received values. This can be checked -to see if there were keywords without any values given. +.. versionadded:: 3.15 + ``<one_value_keywords>`` and ``<multi_value_keywords>`` that were given no + values at all are collected in a variable + ``<prefix>_KEYWORDS_MISSING_VALUES`` that will be undefined if all keywords + received values. This can be checked to see if there were keywords without + any values given. Consider the following example macro, ``my_install()``, which takes similar arguments to the real :command:`install` command: |