2009-12-03 06:25:35 +00:00
|
|
|
|
|
|
|
# CMake script file to process a text file by wrapping every line in double quotes.
|
|
|
|
# Input file must not abuse quotes, staying with single quotes is probably best.
|
|
|
|
|
|
|
|
set( lines "" )
|
|
|
|
file( STRINGS ${inputFile} lines )
|
|
|
|
|
2019-10-01 15:03:00 +00:00
|
|
|
|
|
|
|
#Remark: strings can contain semicolon. a semicolon is a separation in cmake.
|
|
|
|
#so, to avoid stripping semicolon in variables we have to quote them
|
|
|
|
|
2009-12-03 06:25:35 +00:00
|
|
|
file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake from an HTML file\n" )
|
|
|
|
|
|
|
|
foreach( line ${lines} )
|
2019-10-01 15:03:00 +00:00
|
|
|
STRING(REGEX REPLACE "\"" "\\\\\"" linem "${line}" )
|
|
|
|
file( APPEND ${outputFile} "\"" "${linem}" "\\n\"\n" )
|
|
|
|
endforeach( line "${lines}" )
|