Hi,

Should CMakeConfigurableFile.in have a trailing newline? I recently hit
a problem where my contents were made using:

    foreach (...)
        set(contents "${contents}new stuff\n")
    endforeach ()

    set(CMAKE_CONFIGURABLE_FILE_CONTENT "${contents}")
    configure_file(...)

but this caused an extra newline to be placed at the end of the
resulting file (which was not valid for the file being written). I think
at least some documentation that a (native) newline is implicit at the
end of the configured file. 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. This also might
mean a BINARY argument value for NEWLINE_STYLE in configure_file makes
sense to avoid messing with any newlines at all (I can think of
configuring files with HTTP headers which need CRLF but contents with LF
for use in a test suite).

Thoughts?

--Ben
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to