[cmake-developers] [CMake 0013089]: lists parsing is quite strange and not as documented

Mantis Bug Tracker mantis at public.kitware.com
Sat Mar 31 15:39:02 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13089 
====================================================================== 
Reported By:                Christoph Anton Mitterer
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13089
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-03-31 15:39 EDT
Last Modified:              2012-03-31 15:39 EDT
====================================================================== 
Summary:                    lists parsing is quite strange and not as documented
Description: 
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.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-31 15:39 Christoph Anton MittererNew Issue                              
     
======================================================================




More information about the cmake-developers mailing list