[cmake-developers] [RFC] Trailing newline in CMakeConfigurableFile.in
Ben Boeckel
ben.boeckel at kitware.com
Wed May 6 13:29:36 EDT 2015
On Wed, May 06, 2015 at 11:15:55 -0400, Brad King wrote:
> On 05/05/2015 05:44 PM, Ben Boeckel wrote:
> > Should CMakeConfigurableFile.in have a trailing newline?
>
> Prior to a fix in CMake 3.1:
>
> CMakeConfigurableFile: Remove excess newline.
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2f09aff
>
> it actually had *two* trailing newlines.
>
> > at least some documentation that a (native) newline is implicit at the
> > end of the configured file.
>
> Currently CMakeConfigurableFile.in is not documented at all. One could
> document it and add a version without a newline. However, see below.
I'll look at doing this.
> > A version without a newline at the end might
> > be wanted as well in case literal *nix- or Windows-style newlines are
> > required for the format of the file being configured.
>
> Is there any reason not to use file(GENERATE) instead?
file(GENERATE) does not document its newline behavior (nor does it have
options for setting it at all). Does it write in text or binary mode?
--Ben
More information about the cmake-developers
mailing list