mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 797691 - Tip of the day is not rebuilt when the source file changes
Changes to tip_of_the_day.list.c will now properly trigger a rebuild. Plus a few minor assorted fixes and changes to generating the man pages - only generate the final files in share/gnucash, not in the build directory - gnucash-cli.1 was not installed, gnucash.1 twice
This commit is contained in:
@@ -10,5 +10,5 @@ endif()
|
||||
|
||||
set_dist_list(cmake_DIST CMakeLists.txt README_CMAKE.txt cmake_uninstall.cmake.in
|
||||
configure-appdata.cmake configure-gnucash-desktop.cmake configure-manpage.cmake
|
||||
git2version-info.cmake version-info2env.cmake
|
||||
configure-totd.cmake git2version-info.cmake version-info2env.cmake
|
||||
)
|
||||
|
||||
@@ -12,5 +12,4 @@
|
||||
|
||||
include (${SRC_DIR}/cmake/version-info2env.cmake)
|
||||
versioninfo2env (${VCS_INFO_FILE})
|
||||
configure_file(${SRC} ${DST} )
|
||||
configure_file(${DST} ${DATADIR_BUILD}/gnucash/${DST} COPYONLY)
|
||||
configure_file(${SRC} ${DATADIR_BUILD}/gnucash/${DST} )
|
||||
|
||||
24
cmake/configure-totd.cmake
Normal file
24
cmake/configure-totd.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# Command to configure the gnucash man page
|
||||
# These commands are store in a separate cmake file as they have to be
|
||||
# rerun depending on build conditions, not depending on cmake conditions
|
||||
# (such as did the version string change or not)
|
||||
#
|
||||
# The following environment variables are used and should be properly set
|
||||
# by the calling code:
|
||||
# - SRC_DIR (source code directory containing tip_of_the_day.list.c)
|
||||
# - DST_DIR (build dir to write tip_of_the_day.list to)
|
||||
# - SRC (full path to tip_of_the_day.list.c)
|
||||
# - DST (target filename)
|
||||
# - CMAKE_C_COMPILER (path to C compiler, used to parse the input file)
|
||||
file(REMOVE ${DST_DIR}/${TOTD})
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -E -P -x c -DN_\(x\)=x -o ${TOTD}.tmp ${SRC}
|
||||
)
|
||||
|
||||
file(STRINGS ${TOTD}.tmp TIP_OF_THE_DAY_LINES)
|
||||
set(TOTD_OUTPUT "")
|
||||
foreach(line ${TIP_OF_THE_DAY_LINES})
|
||||
string(REGEX REPLACE "^ *\"" "" line2 "${line}")
|
||||
string(REGEX REPLACE "\" *$" "" line3 "${line2}")
|
||||
file(APPEND ${DST_DIR}/${TOTD} "${line3}\n")
|
||||
endforeach()
|
||||
Reference in New Issue
Block a user