Is there a way to loop over multiple lists in parallel in a makefile or CMake file?
I would like to do something like the following in CMake, except AFAICT this syntax i
As of CMake 3.17, the foreach() loop supports a ZIP_LISTS option to iterate through two (or more) lists simultaneously:
foreach()
set(a_values a0 a1 a2) set(b_values b0 b1 b2) foreach(a b IN ZIP_LISTS a_values b_values) message("${a} ${b}") endforeach()
This prints:
a0 b0 a1 b1 a2 b2