diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-03-06 12:41:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-09 15:54:02 (GMT) |
commit | a6fee09484dd467028021e2c54e9791f1b6a0cd1 (patch) | |
tree | 1bda1bde6e6693c668a406781d23abfb57571dd2 /Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake | |
parent | 4a1baca6f79557c61aafd99ae3abed533afa11a2 (diff) | |
download | CMake-a6fee09484dd467028021e2c54e9791f1b6a0cd1.zip CMake-a6fee09484dd467028021e2c54e9791f1b6a0cd1.tar.gz CMake-a6fee09484dd467028021e2c54e9791f1b6a0cd1.tar.bz2 |
file: Add CONFIGURE subcommand
Extend the `file()` command with a new `CONFIGURE` subcommand that
behaves the same as `string(CONFIGURE)` except that it writes the
resulting output immediately to a file.
Fixes: #20388
Diffstat (limited to 'Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake')
-rw-r--r-- | Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake new file mode 100644 index 0000000..e384873 --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake @@ -0,0 +1,20 @@ +set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt) + +function(test_eol style in out) + file(CONFIGURE + OUTPUT ${file_name} + CONTENT "@in@" + NEWLINE_STYLE ${style} + ) + file(READ ${file_name} new HEX) + if(NOT "${new}" STREQUAL "${out}") + message(FATAL_ERROR "No ${style} line endings") + endif() +endfunction() + +test_eol(DOS "a" "610d0a") +test_eol(WIN32 "b" "620d0a") +test_eol(CRLF "c" "630d0a") + +test_eol(UNIX "d" "640a") +test_eol(LF "e" "650a") |