MantisBT - CMake
View Issue Details
0002770CMakeCMakepublic2006-01-27 04:192006-01-30 09:54
Marco Wedekind 
Brad King 
normalmajoralways
closedno change required 
 
 
0002770: semicolons are dropped when reading files with FILE(READ ...)
Reading files with CMake's "FILE(READ filename variable)"-command is buggy. It simply drops all semicolons of the file. No semicolon can be found in the variable which contains the file content read-in by CMake.

Reproduce:

FILE(READ c:/some/file.txt TheFile)
STRING(REGEX MATCHALL ";" Test "${TheFile}")
MESSAGE("${Test}")

does not match any semicolons...
No tags attached.
Issue History

Notes
(0003609)
Brad King   
2006-01-27 13:18   
I'm assigning this bug to myself.

I cannot reproduce the problem with your example code. When I read a file with semicolons I get a message with a bunch of semicolons in it. See the StringFileTest within CMake:

http://www.cmake.org/cgi-bin/viewcvs.cgi/Tests/StringFileTest/?root=CMake [^]

The test could not pass unless semicolons were read and re-written. Adding the lines

STRING(REGEX MATCHALL ";" Test "${infile}")
MESSAGE("[[${Test}]]")

produces the message

[[;;;;;;;;;;;;;;;;;;;;;]]
(0003616)
Marco Wedekind   
2006-01-30 03:01   
Hi Brad,

thanks for your reply. I cannot reproduce the error myself now :| Maybe I have just forgotten some quotation marks? It works for me with the latest cvs-checkout and the official 2.2.3 release.

One thing is still unclear to me... CMake prints more semicolons then were in the file, I guess this is CMake's delimiter?
(0003619)
Brad King   
2006-01-30 09:54   
Yes, lists in CMake are just strings with semicolon delimiters.