Files
kicad-source-mirror/CMakeModules/BuildSteps/Txt2C.cmake
T
Ian McInerney beb50c529e Reorganize the CMake folder to separate build and configure steps
The BuildSteps folder now contains the CMake scripts that are
called during the build process as individual stages, while
the root CMakeModules directory contains the CMake files used
during the configuration phase.
2021-01-28 00:24:22 +00:00

14 lines
509 B
CMake

# CMake script file to process a text file for use as an immediate string value in C/C++.
# It escapes double-quotes and then wraps every line in (unescaped) double-quotes.
set( lines "" )
file( STRINGS ${inputFile} lines )
file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake from a .txt file\n" )
foreach( line IN LISTS lines )
STRING(REGEX REPLACE "\"" "\\\\\"" linem "${line}" )
file( APPEND ${outputFile} "\"" "${linem}" "\\n\"\n" )
endforeach( line "${lines}" )