summaryrefslogtreecommitdiffstats
path: root/Help/command/list.rst
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-02-17 16:47:50 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-19 14:42:36 (GMT)
commita84e509844b74d445b654cd9d0be98a8f0e0641e (patch)
tree30c0de2b685b6103ce0325966b4e1395f658c081 /Help/command/list.rst
parent8ec1942f62a659154abdd99602440757f5eef485 (diff)
downloadCMake-a84e509844b74d445b654cd9d0be98a8f0e0641e.zip
CMake-a84e509844b74d445b654cd9d0be98a8f0e0641e.tar.gz
CMake-a84e509844b74d445b654cd9d0be98a8f0e0641e.tar.bz2
list: add sub-commands PREPEND, POP_BACK, POP_FRONT
Diffstat (limited to 'Help/command/list.rst')
-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