From 1c03d6dec295e7235c560d3451b48fa76b8b6f56 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 29 Sep 2019 17:36:46 +0200 Subject: [PATCH] Add missing file --- CMakeModules/markdown2C.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CMakeModules/markdown2C.cmake diff --git a/CMakeModules/markdown2C.cmake b/CMakeModules/markdown2C.cmake new file mode 100644 index 0000000000..cabf134849 --- /dev/null +++ b/CMakeModules/markdown2C.cmake @@ -0,0 +1,14 @@ +# 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. +# note also empty lines cannot be stripped: they have a meaning (separator) in markdown +# so we use file( READ ... ) to read the full file content, including empty lines + +file( READ ${inputFile} buffer ) + +file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake from an .md file\n" ) + +# Replace each EOL char by "\n" + " + EOL +STRING(REGEX REPLACE "\n" "\\\\n\"\n\"" buff_m ${buffer}) + +# Write the buffer between quotes +file( APPEND ${outputFile} "_HKI( \"" ${buff_m} "\" )\n" )