summaryrefslogtreecommitdiff
path: root/CMakeModules/Html2C.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeModules/Html2C.cmake')
-rw-r--r--CMakeModules/Html2C.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeModules/Html2C.cmake b/CMakeModules/Html2C.cmake
new file mode 100644
index 0000000..99919b3
--- /dev/null
+++ b/CMakeModules/Html2C.cmake
@@ -0,0 +1,13 @@
+
+# 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 )
+
+file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake from an HTML file\n" )
+
+foreach( line ${lines} )
+ STRING(REGEX REPLACE "\"" "\\\\\"" linem ${line})
+ file( APPEND ${outputFile} "\"" ${linem} "\\n\"\n" )
+endforeach( line ${lines} )