1while 2----- 3 4Evaluate a group of commands while a condition is true 5 6.. code-block:: cmake 7 8 while(<condition>) 9 <commands> 10 endwhile() 11 12All commands between while and the matching :command:`endwhile` are recorded 13without being invoked. Once the :command:`endwhile` is evaluated, the 14recorded list of commands is invoked as long as the ``<condition>`` is true. 15 16The ``<condition>`` has the same syntax and is evaluated using the same logic 17as described at length for the :command:`if` command. 18 19The commands :command:`break` and :command:`continue` provide means to 20escape from the normal control flow. 21 22Per legacy, the :command:`endwhile` command admits 23an optional ``<condition>`` argument. 24If used, it must be a verbatim repeat of the argument of the opening 25``while`` command. 26