mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-22 00:47:42 -06:00
c4a21bc9d4
This simplifies a number of escape sequences. The generated file to configure the man page was split up a bit further: - code that extracted the GNC_VCS_REV_Y_M from gnc-vcs-info.h was spun out into its own function that now sets all parameters in gnc-vcs-info.h as environment variables. - this function is now invoked by configure-manpage.cmake to extract the date to insert into the manpage. - the manpage in addition now shows the full date rather than only yyyy-mm. This is how man itself does it as well.
14 lines
504 B
CMake
14 lines
504 B
CMake
# Extract the parameters set in _VCS_INFO_FILE and export them as environment variables
|
|
|
|
# _VCS_INFO_FILE should be the full path to gnc-vcs-info.h
|
|
|
|
function (versioninfo2env _VCS_INFO_FILE)
|
|
file(STRINGS ${_VCS_INFO_FILE} lines REGEX "#define")
|
|
foreach(line ${lines})
|
|
string(REGEX REPLACE "^.* (.*) \"(.*)\"" "\\1;\\2" _param_val ${line})
|
|
list(GET _param_val 0 _param)
|
|
list(GET _param_val 1 _val)
|
|
set(${_param} ${_val} PARENT_SCOPE)
|
|
endforeach()
|
|
endfunction()
|