Documentation inconsistent for macro arguments
https://cmake.org/cmake/help/v3.16/command/macro.html says
Argument Caveats
Since ARGN, ARGC, ARGV, ARGV0 etc. are not variables, you will NOT be able to use commands like
...
foreach(loop_var IN LISTS ARGN) # ARGN is not a variable
...
Note that if you have a variable with the same name in the scope from which the macro is called, using unreferenced names will use the existing variable instead of the arguments. For example:
macro(bar)
foreach(arg IN LISTS ARGN)
<commands>
endforeach()
endmacro()
...
That is, the macro(bar)
example is using the foreach(arg IN LISTS ARGN)
that was just deemed unusable a few lines above, which is confusing (and I do not think the example is intended to show this).
PS. I am new here. This may be the wrong place to report this. I saw no obvious feedback functionality at the documentation page.