1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#MACRO(COMPILE_KERNEL input_file)
set(output_file "${input_file}.h")
file(READ "${input_file}" contents)
string(REGEX REPLACE ";" "\\\\;" contents "${contents}")
string(REGEX REPLACE "\n" "E;" contents "${contents}")
message(${output_file})
file(WRITE "${output_file}")
foreach(lineE ${contents})
string(REGEX REPLACE "^(.*)E$" "\\1" line "${lineE}")
file(APPEND "${output_file}" " \"${line}\\n\"\n")
endforeach()
file(APPEND "${output_file}" ";\n")
#ENDMACRO()
|