[CMake] LIST bugs for cmake version 2.6-patch 0 RC-8

Bill Hoffman bill.hoffman at kitware.com
Wed May 7 13:40:08 EDT 2008


Alan W. Irwin wrote:
> On 2008-05-07 09:12-0700 Alan W. Irwin wrote:

> foreach(element ${list_example})
>   message("${element}")
> endforeach(element list_example)
> 
> The result is
> 
> input list_example = 1;;;2;3;4;5
> individual elements are listed as follows:
> 1
> 2
> 3
> 4
> 5
> 
> Clearly, the empty elements are (incorrectly) being skipped in the foreach
> loop.
> 

Nothing we can do about the foreach.  The ${list_example} is being 
expanded before foreach gets the list.   The only thing we could do is 
change the signature of foreach to take a variable name as well as what 
it takes now.

-Bill


More information about the CMake mailing list