list: add sub-commands PREPEND, POP_BACK, POP_FRONT

This commit is contained in:
Alex Turbov
2019-02-18 00:47:50 +08:00
committed by Brad King
parent 8ec1942f62
commit a84e509844
17 changed files with 388 additions and 7 deletions
+34 -2
View File
@@ -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