File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 55# Usage: cmake -P generate_file_list.cmake
66# ======================================================================
77
8- cmake_minimum_required (VERSION 3.10 )
8+ cmake_minimum_required (VERSION 3.20 )
99
1010function (generate_file_list SOURCE_ROOT PATTERNS_LIST OUTPUT_FILE)
1111 set (ALL_ENTRIES "" )
@@ -32,7 +32,13 @@ function(generate_file_list SOURCE_ROOT PATTERNS_LIST OUTPUT_FILE)
3232
3333 # 5. Generate output file
3434 string (JOIN "\n " FILES_ONLY_STRING ${FILES_ONLY} )
35- file (WRITE "${OUTPUT_FILE} " "${FILES_ONLY_STRING} \n " )
35+ file (WRITE "${OUTPUT_FILE} .temp" "${FILES_ONLY_STRING} \n " )
36+
37+ # 6. Convert line endings
38+ configure_file ("${OUTPUT_FILE} .temp" "${OUTPUT_FILE} " @ONLY NEWLINE_STYLE LF)
39+
40+ # 7. Remove temp file
41+ file (REMOVE "${OUTPUT_FILE} .temp" )
3642
3743 message (STATUS "Generated file list in: ${OUTPUT_FILE} " )
3844endfunction ()
You can’t perform that action at this time.
0 commit comments