diff options
author | Ashley Whetter <ashley@awhetter.co.uk> | 2016-01-28 21:29:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-02-03 16:13:17 (GMT) |
commit | 0205f882ae252998686f65b843a758268b4c62bc (patch) | |
tree | 33c19806797e81f6ef65ee3fbe53b0c1188dae72 /Help/command/list.rst | |
parent | a58abc69c23ef30fc2215eb72878af29f7e860fd (diff) | |
download | CMake-0205f882ae252998686f65b843a758268b4c62bc.zip CMake-0205f882ae252998686f65b843a758268b4c62bc.tar.gz CMake-0205f882ae252998686f65b843a758268b4c62bc.tar.bz2 |
list: Add FILTER subcommand (#3986)
Create a `list(FILTER)` command to filter lists by regular expression.
Diffstat (limited to 'Help/command/list.rst')
-rw-r--r-- | Help/command/list.rst | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Help/command/list.rst b/Help/command/list.rst index a7a05c7..f6b75bc 100644 --- a/Help/command/list.rst +++ b/Help/command/list.rst @@ -9,6 +9,7 @@ List operations. list(GET <list> <element index> [<element index> ...] <output variable>) list(APPEND <list> [<element> ...]) + list(FILTER <list> <INCLUDE|EXCLUDE> REGEX <regular_expression>) list(FIND <list> <value> <output variable>) list(INSERT <list> <element_index> <element> [<element> ...]) list(REMOVE_ITEM <list> <value> [<value> ...]) @@ -23,6 +24,12 @@ List operations. ``APPEND`` will append elements to the list. +``FILTER`` will include or remove items from the list that match the +mode's pattern. +In ``REGEX`` mode, items will be matched against the given regular expression. +For more information on regular expressions see also the :command:`string` +command. + ``FIND`` will return the index of the element specified in the list or -1 if it wasn't found. @@ -38,9 +45,9 @@ difference is that ``REMOVE_ITEM`` will remove the given items, while ``SORT`` sorts the list in-place alphabetically. -The list subcommands ``APPEND``, ``INSERT``, ``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 +The list subcommands ``APPEND``, ``INSERT``, ``FILTER``, ``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 scope. To propagate the results of these operations upwards, use |