MantisBT - CMake
View Issue Details
0005533CMakeCCMakepublic2007-08-18 08:002009-12-14 12:03
Philippe Fremy 
Brad King 
lowminoralways
closedduplicate 
 
 
0005533: CONFIGURE_FILE should keep the line-ending convention of the input file
I am on windows, using CMake 2.4.7 (windows install) but using the cygwin bash to process some files. One of the bash scripts is generated by CONFIGURE_FILE(). The problem is that the input file is with unix line endings, and the output file is with windows line endings. And cygwin bash always wants unix line endings:

I suggest to let CONFIGURE_FILE() output the file in the same encoding and line-ending than the original one.

User@Phil_vaio /cygdrive/d/work/work/yzis-dev/yzis-qtm/tests $ cat CMakeLists.t
xt

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/env_test.sh.in ${CMAKE_CURRENT_SOURCE_DIR}/env_t
est.sh
    @ONLY
)


User@Phil_vaio /cygdrive/d/work/work/yzis-dev/yzis-qtm/tests $ file env_test.sh
.in
env_test.sh.in: ASCII text
User@Phil_vaio /cygdrive/d/work/work/yzis-dev/yzis-qtm/tests $ file env_test.sh
env_test.sh: ASCII text, with CRLF line terminators
No tags attached.
related to 0003957closed Brad King FILE(WRITE) produce wrong line endings 
Issue History
2007-08-18 08:00Philippe FremyNew Issue
2007-08-18 08:01Philippe FremyNote Added: 0008506
2007-12-18 09:58Bill HoffmanStatusnew => assigned
2007-12-18 09:58Bill HoffmanAssigned To => David Cole
2008-10-10 18:08David ColeAssigned ToDavid Cole => Brad King
2008-10-10 18:11David ColeRelationship addedrelated to 0003957
2008-10-20 17:11David ColeAssigned ToBrad King => David Cole
2008-10-20 17:13David ColeNote Added: 0013911
2009-01-22 14:04David ColePrioritynormal => low
2009-01-22 14:04David ColeCategory => CCMake
2009-12-10 14:09David ColeAssigned ToDavid Cole => Brad King
2009-12-14 12:03Brad KingNote Added: 0018858
2009-12-14 12:03Brad KingStatusassigned => closed
2009-12-14 12:03Brad KingResolutionopen => duplicate

Notes
(0008506)
Philippe Fremy   
2007-08-18 08:01   
See also: http://www.cmake.org/Bug/view.php?id=3957 [^]

The problem is similar but for the FILE(WRITE ) command.
(0013911)
David Cole   
2008-10-20 17:13   
Brad King / David Cole discussed via email on October 10, 2008
(0018858)
Brad King   
2009-12-14 12:03   
In issue 0003957 I already mention that the problem is related to configure_file. To keep discussion in one place I'm closing this as a duplicate.