foreach: Introduce `CMAKE_FOREACH_INDEX` variable
Sometimes during foreach(... IN LISTS|ITEMS)
it's needed to know the index of the current element (e.g., to print the numbered list of smth). The added CMAKE_FOREACH_INDEX
variable reduce the boilerplate code involving math
and additional variable.
Topic-rename: foreach-index
Edited by Brad King