MantisBT - CMake
View Issue Details
0014035CMakeCMakepublic2013-03-22 06:062013-10-07 10:04
Ove Sommer 
 
highmajoralways
closedduplicate 
Linux and Windows (independent)Linux 2.6.37.6-0.11 + Windows 7
CMake 2.8.10.2 
 
0014035: list(LENGTH ...) stops counting on special entries
If a list of single-quoted strings contains an entry with an opening angle bracket (ASCII 0x5b '[') the LENGTH sub-command stops counting entries following this bracket entry.

Example: list L: 'a';'b';'c[';'d';'e' => list(LENGTH L lenL) => lenL=3
but actually lenL=5
list(APPEND l 'a';'b';'c[';'d';'e')
list(LENGTH l llen)
message("len(l) = ${llen}, l = ${l}")
The list was created by parsing a file via
file(STRINGS "${myFile}" MY_LINES REGEX "^ some_regexp.*$")

MY_LINES contains all entries, one of it contains an opening angle bracket followed by a single quote.

This bug already occurs in CMake 2.8.2 which we actually use.
No tags attached.
? listLenTest.cmake (386) 2013-03-22 06:06
https://public.kitware.com/Bug/file/4691/listLenTest.cmake
Issue History
2013-03-22 06:06Ove SommerNew Issue
2013-03-22 06:06Ove SommerFile Added: listLenTest.cmake
2013-03-22 08:04Brad KingNote Added: 0032684
2013-03-22 08:04Brad KingStatusnew => resolved
2013-03-22 08:04Brad KingResolutionopen => duplicate
2013-10-07 10:04Robert MaynardNote Added: 0034013
2013-10-07 10:04Robert MaynardStatusresolved => closed

Notes
(0032684)
Brad King   
2013-03-22 08:04   
List expansion is protected by [] because the find_* command syntax for windows registry entries has a semicolon inside [] and pre-dated lists.

I'm resolving this as a duplicate of 0013806 because the underlying issue is the same.
(0034013)
Robert Maynard   
2013-10-07 10:04   
Closing resolved issues that have not been updated in more than 4 months.