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

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 7 12:30:23 EDT 2008


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

> On 2008-04-19 11:46-0700 Alan W. Irwin wrote:
>
>> On 2008-04-18 15:14-0400 Bill Hoffman wrote:
>>> OK, so it is not a regression...   Can you please create a bug entry for 
>>> this.  Thanks.
>> 
>> Done, see http://public.kitware.com/Bug/view.php?id=6852.
>
> This bug had been closed, but the fix is not quite complete yet.  For CMake
> 2.6.0 my test script (with
>
> cmake_minimum_required(VERSION 2.6)
>
> prepended) gives good results for all results except the SORT one.
>
> Here is a short test script to show the issue.
>
> cmake_minimum_required(VERSION 2.6)
> set(list_example "1;;;2;3;4;5")
> message("input list_example = ${list_example}")
> list(SORT list_example)
> message("sorted list_example = ${list_example}")
>
> The result is
>
> input list_example = 1;;;2;3;4;5
> sorted list_example = 1;2;3;4;5
>
> Obviously, the empty elements should show up in the sorted list but they
> don't.
>
> Bill, should I enter this as a new bug, reopen the old bug, or is the fix
> so trivial I don't need to do either?

I found another instance where empty elements don't work properly.
Here is a simple test script illustrating the problem:

cmake_minimum_required(VERSION 2.6)
set(list_example "1;;;2;3;4;5")
message("input list_example = ${list_example}")
message("individual elements are listed as follows:")
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.

Bill, separate bug report, reopen old one, or trivial fix?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list