configure-totd.cmake (gnucash-5.0.tar.bz2) | : | configure-totd.cmake (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 18 | skipping to change at line 18 | |||
# - SRC_DIR (source code directory containing tip_of_the_day.list.c) | # - SRC_DIR (source code directory containing tip_of_the_day.list.c) | |||
# - DST_DIR (build dir to write tip_of_the_day.list to) | # - DST_DIR (build dir to write tip_of_the_day.list to) | |||
# - SRC (full path to tip_of_the_day.list.c) | # - SRC (full path to tip_of_the_day.list.c) | |||
# - DST (target filename) | # - DST (target filename) | |||
# - CMAKE_C_COMPILER (path to C compiler, used to parse the input file) | # - CMAKE_C_COMPILER (path to C compiler, used to parse the input file) | |||
file(REMOVE ${DST_DIR}/${TOTD}) | file(REMOVE ${DST_DIR}/${TOTD}) | |||
execute_process( | execute_process( | |||
COMMAND ${CMAKE_C_COMPILER} -E -P -x c -DN_\(x\)=x -o ${TOTD}.tmp ${SRC} | COMMAND ${CMAKE_C_COMPILER} -E -P -x c -DN_\(x\)=x -o ${TOTD}.tmp ${SRC} | |||
) | ) | |||
file(STRINGS ${TOTD}.tmp TIP_OF_THE_DAY_LINES) | file(STRINGS ${TOTD}.tmp TIP_OF_THE_DAY_LINES ENCODING UTF-8) | |||
set(TOTD_OUTPUT "") | set(TOTD_OUTPUT "") | |||
foreach(line ${TIP_OF_THE_DAY_LINES}) | foreach(line ${TIP_OF_THE_DAY_LINES}) | |||
string(REGEX REPLACE "^ *\"" "" line2 "${line}") | string(REGEX REPLACE "^ *\"" "" line2 "${line}") | |||
string(REGEX REPLACE "\" *$" "" line3 "${line2}") | string(REGEX REPLACE "\" *$" "" line3 "${line2}") | |||
file(APPEND ${DST_DIR}/${TOTD} "${line3}\n") | file(APPEND ${DST_DIR}/${TOTD} "${line3}\n") | |||
endforeach() | endforeach() | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |