MantisBT - CMake
View Issue Details
0015212CMake(No Category)public2014-10-20 07:572015-04-06 09:07
toncho11 
 
normalminorhave not tried
closedno change required 
Windows
CMake 3.0.2 
 
0015212: FILE READ skips semicolumn ;
Every time I try to read a file with semicolumns, the resulted variable does not contain it.

It is pretty annoying when you finally find a way to do what you want and then you encounter a bug ...
No tags attached.
Issue History
2014-10-20 07:57toncho11New Issue
2014-10-20 09:06Brad KingNote Added: 0037051
2014-10-22 14:01Brad KingStatusnew => resolved
2014-10-22 14:01Brad KingResolutionopen => no change required
2015-04-06 09:07Robert MaynardNote Added: 0038428
2015-04-06 09:07Robert MaynardStatusresolved => closed

Notes
(0037051)
Brad King   
2014-10-20 09:06   
Without a code example it is difficult to know what you're doing, but I suspect you're trying

 file(READ myfile.txt myvar)
 message(${myvar})

The unquoted argument gets split into multiple arguments on ; and then message() displays each argument consecutively. See the cmake-language(7) manual:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-language.7.html [^]

for details on that. You can use quotes to make sure an argument is treated as a single value:

 message("${myvar}")
(0038428)
Robert Maynard   
2015-04-06 09:07   
Closing resolved issues that have not been updated in more than 4 months.