[CMake] Generating source code packages with Windows line endings

Arjen Markus arjen.markus at wldelft.nl
Tue Jun 24 00:30:27 EDT 2008


> On Monday 23 June 2008 19:26:36 Mike Jackson wrote:
>> Could you list off the top of your head some of the tools that have
>> given you trouble? I have never run into the line ending issues yet
>> but I may in the future. I would be good to have an idea what tools
>> will NOT handle unix line endings.
> Notepad.
>
> You may think I'm joking but it becomes surprisingly annoying to open an
> e.g.
> CMakeLists file in Notepad and have it be unreadable so you have to open
> it
> up in another tool.
>
> Can't think of anything else I actually use that has that problem but
> the "default Windows editor" doesn't like them.
>

I have run into problems with UNIX line-endings in the
following circumstances:

- Batch files on Windows 95 (also 98?):
  My favourite Windows editor is normally set to produce UNIX-style
  output, but batch files under Windows 95 with UNIX line-endings
  seemed to be regarded as one single line. This is no longer a problem
  with Windows NT and XP.

- Visual Basic programs (VB 6 at least, do not know about VB.net):
  One typical example is that they can not read INI files with
  such line-endings. Probably other files are a problem too.

- Source-code control systems:
  They typically (?) seem to get confused when confronted with
  a file whose versions use different line-endings - each line
  will be regarded as changed then. (This can really mess up
  the change history!)

Undoubtedly there are other things, but these are what I can
come up with right now.

In general though, compilers for C, Fortran, Java, ... have
no problem at all. Also the generated programs can deal with
both types of line-endings.

Most editors - notepad is the notorious exception - under
Windows accept UNIX-style files too.

Regards,

Arjen


More information about the CMake mailing list