MantisBT - CMake
View Issue Details
0014785CMakeCMakepublic2014-03-04 16:362014-10-06 10:32
toeb 
 
normalminoralways
closedno change required 
x86Windows7
CMake 2.8.12.2 
 
0014785: Unexpected behaviour in list when brackets are involved
if semicoli inside are inside brackets [] they are not treated as list delimiters in a foreach loop
set(lst"1;2;[;3;4;5;];6;7")
foreach(element ${lst})
  message("${element}")
endforeach()

# prints
# 1
# 2
# [;3;4;5;]
# 6
# 7
# what i expected:
# 1
# 2
# [
# 3
# 4
# 5
# ]
# 6
# 7
maybe it has somethingto do with variable evaluation inside foreach? (just a guess)
No tags attached.
Issue History
2014-03-04 16:36toebNew Issue
2014-03-04 16:39Brad KingNote Added: 0035250
2014-03-06 10:37Brad KingStatusnew => resolved
2014-03-06 10:37Brad KingResolutionopen => no change required
2014-10-06 10:32Robert MaynardNote Added: 0036933
2014-10-06 10:32Robert MaynardStatusresolved => closed

Notes
(0035250)
Brad King   
2014-03-04 16:39   
This is documented behavior:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-language.7.html#lists [^]
 "...splitting on ; characters not following an unequal number of [ and ] characters..."
(0036933)
Robert Maynard   
2014-10-06 10:32   
Closing resolved issues that have not been updated in more than 4 months.