MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0015369 | CMake | CMake | public | 2015-01-23 14:32 | 2015-06-01 08:38 |
|
Reporter | Joakim Söderberg | |
Assigned To | | |
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | won't fix | |
Platform | | OS | | OS Version | |
Product Version | CMake 2.8.12.2 | |
Target Version | | Fixed in Version | | |
|
Summary | 0015369: file(STRINGS file VAR) fails to read entire file |
Description | I am experiencing some weird issues with file(STRINGS.
It fails to read my entire file. The file is 2529 lines long, but CMake only read 1885. Or well it reads the entire file, but then stops splitting it up into lines, instead the last list entry consists of all the lines between 1885-2529. |
Steps To Reproduce | cmake -DFILE=thefile.gcov -P testscript.cmake
testscript:
file(STRINGS ${FILE} LIST)
list(LENGTH LIST LIST_COUNT)
message("${LIST_COUNT}") |
Additional Information | I have not been able to test with a later CMake yet. But I hope there is some workaround for this for older versions as well. |
Tags | No tags attached. |
Relationships | |
Attached Files | thefile.gcov (93,126) 2015-01-23 14:32 https://public.kitware.com/Bug/file/5360/thefile.gcov |
|
Issue History |
Date Modified | Username | Field | Change |
2015-01-23 14:32 | Joakim Söderberg | New Issue | |
2015-01-23 14:32 | Joakim Söderberg | File Added: thefile.gcov | |
2015-01-23 14:37 | Brad King | Note Added: 0037793 | |
2015-01-23 14:37 | Brad King | Status | new => resolved |
2015-01-23 14:37 | Brad King | Resolution | open => won't fix |
2015-01-23 14:51 | Joakim Söderberg | Note Added: 0037794 | |
2015-01-23 14:58 | Brad King | Note Added: 0037795 | |
2015-01-23 15:21 | Joakim Söderberg | Note Added: 0037799 | |
2015-06-01 08:38 | Robert Maynard | Note Added: 0038856 | |
2015-06-01 08:38 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0037793)
|
Brad King
|
2015-01-23 14:37
|
|
|
|
(0037794)
|
Joakim Söderberg
|
2015-01-23 14:51
|
|
Ok, so I'm just screwed then? No way around this, except adding matching brackets (which I have confirmed works) as comments in the file.
So I'm totally in the wrong even trying something like this?:
https://github.com/JoakimSoderberg/coveralls-cmake/blob/master/cmake/CoverallsGenerateGcov.cmake [^]
Actually this is not the first time I've run into problems with how lists works. But I guess code like the above is better to write in an external C program that is compiled and passed the input. |
|
|
(0037795)
|
Brad King
|
2015-01-23 14:58
|
|
Re 0015369:0037794: I don't think implementing coverage file parsing in the CMake language is a good idea.
CMake language lists were designed to do lists of source files. Their restrictions with respect to ";", "[", and "]" were necessary for compatibility with existing behavior at the time they were introduced. It was never designed to be general purpose.
At best you could hack around the limitation by using string(REPLACE) to substitute placeholders for "[" and "]" before doing anything else with the result of file(STRINGS). |
|
|
(0037799)
|
Joakim Söderberg
|
2015-01-23 15:21
|
|
|
|
(0038856)
|
Robert Maynard
|
2015-06-01 08:38
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|