summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-20 14:04:48 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-20 14:04:58 (GMT)
commite0fbb7bf0843615e805ec325432d0c6d2ef9a30e (patch)
tree04b844c8520d0c8f77630d006ff9c3472614fccc /Help/command
parentc2f6da3399efa1448eadbae65311795ced3f8930 (diff)
parenta84e509844b74d445b654cd9d0be98a8f0e0641e (diff)
downloadCMake-e0fbb7bf0843615e805ec325432d0c6d2ef9a30e.zip
CMake-e0fbb7bf0843615e805ec325432d0c6d2ef9a30e.tar.gz
CMake-e0fbb7bf0843615e805ec325432d0c6d2ef9a30e.tar.bz2
Merge topic 'list-prepend-and-pop-subcommands'
a84e509844 list: add sub-commands PREPEND, POP_BACK, POP_FRONT Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2980
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/list.rst36
1 files changed, 34 insertions, 2 deletions
diff --git a/Help/command/list.rst b/Help/command/list.rst
index bfcdf34..6c86c2a 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -21,6 +21,9 @@ Synopsis
list(`APPEND`_ <list> [<element>...])
list(`FILTER`_ <list> {INCLUDE | EXCLUDE} REGEX <regex>)
list(`INSERT`_ <list> <index> [<element>...])
+ list(`POP_BACK`_ <list> [<out-var>...])
+ list(`POP_FRONT`_ <list> [<out-var>...])
+ list(`PREPEND`_ <list> [<element>...])
list(`REMOVE_ITEM`_ <list> <value>...)
list(`REMOVE_AT`_ <list> <index>...)
list(`REMOVE_DUPLICATES`_ <list>)
@@ -33,8 +36,9 @@ Synopsis
Introduction
^^^^^^^^^^^^
-The list subcommands ``APPEND``, ``INSERT``, ``FILTER``, ``REMOVE_AT``,
-``REMOVE_ITEM``, ``REMOVE_DUPLICATES``, ``REVERSE`` and ``SORT`` may create
+The list subcommands ``APPEND``, ``INSERT``, ``FILTER``, ``PREPEND``,
+``POP_BACK``, ``POP_FRONT``, ``REMOVE_AT``, ``REMOVE_ITEM``,
+``REMOVE_DUPLICATES``, ``REVERSE`` and ``SORT`` may create
new values for the list within the current CMake variable scope. Similar to
the :command:`set` command, the LIST command creates new variable values in
the current scope, even if the list itself is actually defined in a parent
@@ -142,6 +146,34 @@ For more information on regular expressions see also the
Inserts elements to the list to the specified location.
+.. _POP_BACK:
+
+.. code-block:: cmake
+
+ list(POP_BACK <list> [<out-var>...])
+
+If no variable name is given, removes exactly one element. Otherwise,
+assign the last element's value to the given variable and removes it,
+up to the last variable name given.
+
+.. _POP_FRONT:
+
+.. code-block:: cmake
+
+ list(POP_FRONT <list> [<out-var>...])
+
+If no variable name is given, removes exactly one element. Otherwise,
+assign the first element's value to the given variable and removes it,
+up to the last variable name given.
+
+.. _PREPEND:
+
+.. code-block:: cmake
+
+ list(PREPEND <list> [<element> ...])
+
+Insert elements to the 0th position in the list.
+
.. _REMOVE_ITEM:
.. code-block:: cmake