Skip to content

foreach: Introduce `CMAKE_FOREACH_INDEX` variable

Alex Turbov requested to merge zaufi/cmake:feature/CMAKE_FOREACH_INDEX into master

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

Merge request reports