MantisBT - CMake
View Issue Details
0013007CMakeCMakepublic2012-03-01 17:292016-06-10 14:31
Daniel Richard G. 
Kitware Robot 
normalfeaturealways
closedmoved 
CMake 2.8.7 
 
0013007: "cmake -E compare_files" needs an option to ignore line endings
"cmake -E compare_files" is currently the equivalent of cmp(1), in that it checks whether or not two files are bit-for-bit identical. If you compare two text files that are the same except for one having Unix/LF line endings and the other having DOS/CRLF line endings, compare_files will indicate that they are different.

This behavior is not helpful when the files are unavoidably going to differ in EOL convention. In my case, I have a CMake framework to build a text-processing tool that is native to Unix, but is also usable in Windows. There is a test suite, in which the tool generates textual output, and the output is compared to a reference file. On Windows, the tool necessarily outputs CRLF text. But the test-reference files are necessarily LF, because they were produced on Unix, where the tool is maintained.

Currently, I am using CONFIGURE_FILE() as an improvised way of converting the tool-output file from CRLF to LF so that compare_files can work as intended, and the test suite gives meaningful results. However, this won't work if the file happens to contain "${VAR}" and "@VAR@" constructs, and while COPYONLY would be safer, it is not compatible with the necessary NEWLINE_STYLE directive.

What is really needed is an option to compare_files that tells it to compare the two files as text, disregarding any differences in the line-ending convention.
No tags attached.
Issue History
2012-03-01 17:29Daniel Richard G.New Issue
2012-08-11 21:35David ColeStatusnew => backlog
2012-08-11 21:35David ColeNote Added: 0030409
2016-06-10 14:28Kitware RobotNote Added: 0041994
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0030409)
David Cole   
2012-08-11 21:35   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041994)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.