1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 18:15:17 +00:00

Make version string semver compliant, add git sha

Per https://semver.org/, use `-pre` rather than `_pre` version postfix,
and include the git short commit hash in the version string.
This commit is contained in:
Brenden Matthews 2024-05-01 14:33:07 -04:00
parent d8c8fd3de5
commit e8fd689b92

View File

@ -176,11 +176,16 @@ execute_process(COMMAND ${APP_UNAME} -sm
OUTPUT_VARIABLE BUILD_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${APP_GIT} rev-parse --short HEAD
RESULT_VARIABLE RETVAL
OUTPUT_VARIABLE GIT_SHORT_SHA
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(RELEASE)
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
else(RELEASE)
set(VERSION
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_pre${COMMIT_COUNT}")
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-pre-${GIT_SHORT_SHA}")
endif(RELEASE)
set(COPYRIGHT "Copyright Brenden Matthews, et al, 2005-2024")