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

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 7 19:47:09 EDT 2008


Bill,

Here is a simple version of a LIST test that demonstrates a REMOVE_ITEM bug.
(My original test script also shows the same bug, but there are so many
results there that I didn't see it until now.  Sorry.)

cmake_minimum_required(VERSION 2.6)

set(list_example "1;;;2;3;;;4;5;1;;")
message("input list_example = ${list_example}")
list(REMOVE_ITEM list_example "1")
message("remove 1 list_example = ${list_example}")
message("")

set(list_example "1;;;2;3;;;4;5;1;;")
message("input list_example = ${list_example}")
list(REMOVE_ITEM list_example "")
message("remove empty list_example = ${list_example}")
message("")

The result is

input list_example = 1;;;2;3;;;4;5;1;;
remove 1 list_example = 2;3;;;4;5;;

input list_example = 1;;;2;3;;;4;5;1;;
remove empty list_example = 1;2;3;4;5;1

The first result removes the "1" elements correctly, but also incorrectly
drops the first empty elements (but not the others).

The second result seems to remove all empty elements correctly, but this
second result should be included in the test in case the fix for the error
in the first result affects the second result.

Thanks in advance for fixing this bug.

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