.. _dune_list_filter:

dune_list_filter
================

.. cmake_function:: dune_list_filter

   .. cmake_brief::

      Compatibility implementation of ``list(FILTER)``

   .. cmake_param:: list
      :positional:
      :single:
      :required:

      Name of list variable used as both input and output.

   .. cmake_param:: <INCLUDE|EXCLUDE>
      :positional:
      :option:
      :required:

      Whether to include or to exclude the items matching the regular
      expression.

   .. cmake_param:: REGEX
      :single:
      :required:
      :argname: regular_expression

      The regular expression to match the items against.

   Match each item in the list against the regular expression.  In
   ``INCLUDE`` mode the result contains all items that matched, in
   ``EXCLUDE`` mode it contains all items that did not match.  Store the
   result back in the variable ``list`` in the scope of the caller.

   This is exactly the same as the ``list(FILTER ...)`` command available in
   cmake 3.7 and onward.
