MantisBT - CMake
View Issue Details
0013089CMakeCMakepublic2012-03-31 15:392012-09-03 16:00
Christoph Anton Mitterer 
Brad King 
normalminoralways
closedsuspended 
 
 
0013089: lists parsing is quite strange and not as documented
Hi.

http://www.cmake.org/cmake/help/syntax.html [^]
tells that lists are set like:
set(VAR a;b;c)
or
set(VAR a b c)


However, when using string literals this doesn't work anymore, e.g.
1) List items separated by semicolons
set(foo "1 1";"2 2";"3 3")
message(${foo})
foreach(ff IN LISTS foo)
        message("dd: ${ff}")
endforeach()

=> yields in:
1 1"2 2""3 3"
dd: 1 1
dd: "2 2"
dd: "3 3"


2) List items separated by spaces
set(foo "1 1" "2 2" "3 3")
message(${foo})
foreach(ff IN LISTS foo)
        message("dd: ${ff}")
endforeach()

=> yields in:
1 12 23 3
dd: 1 1
dd: 2 2
dd: 3 3


(2) Is obviously what one would expect in both cases.


Cheers,
Chris.
No tags attached.
Issue History
2012-03-31 15:39Christoph Anton MittererNew Issue
2012-04-09 09:03Brad KingNote Added: 0029098
2012-04-09 09:03Brad KingStatusnew => resolved
2012-04-09 09:03Brad KingResolutionopen => suspended
2012-04-09 09:03Brad KingAssigned To => Brad King
2012-09-03 16:00David ColeNote Added: 0030848
2012-09-03 16:00David ColeStatusresolved => closed

Notes
(0029098)
Brad King   
2012-04-09 09:03   
Issues 0013083, 0013089, 0013090, 0013091, 0013092, 0013109, and 0013111 are all interesting suggestions but the issue tracker is not a good place to discuss them. The user list is a better place for discussion because it may attract interest from others, and in particular from potential contributors. Others may also suggest alternative solutions.
(0030848)
David Cole   
2012-09-03 16:00   
Closing resolved issues that have not been updated in more than 4 months.