https://github.com/Kitware/CMake
Raw File
Tip revision: 30c3effa89ceda247cd2ff29b5d3f4da8c7a8ff6 authored by Brad King on 01 February 2019, 13:23:46 UTC
CMake 3.13.4
Tip revision: 30c3eff
while.rst
while
-----

Evaluate a group of commands while a condition is true

::

  while(condition)
    COMMAND1(ARGS ...)
    COMMAND2(ARGS ...)
    ...
  endwhile(condition)

All commands between while and the matching :command:`endwhile` are recorded
without being invoked.  Once the :command:`endwhile` is evaluated, the
recorded list of commands is invoked as long as the condition is true.  The
condition is evaluated using the same logic as the :command:`if` command.
back to top