0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 00:18:06 +03:00

Automate version generation

Version is now generated automatically based on git tags.
Both cases are handled: building from git tree and building tarball downloaded from github.

Works for qmake and cmake
This commit is contained in:
Андрей Лухнов
2024-09-02 15:32:42 +03:00
parent a9126d51c6
commit b534c2bec0
12 changed files with 98 additions and 30 deletions

View File

@@ -213,3 +213,19 @@ FORMS += \
RESOURCES += \
$$REPORT_PATH/report.qrc \
$$REPORT_PATH/items/items.qrc
system("git --version") {
LR_VERSION = $$system("git --git-dir=$$PWD/../.git describe --tags --dirty")
} else {
LR_VERSION = "0.0.0-unknown"
}
VERSION_TEMPLATE = $$PWD/version.h.in
generateversion.depends = FORCE
generateversion.input = VERSION_TEMPLATE
generateversion.output = $$OUT_PWD/version.h
generateversion.commands = $$QMAKE_STREAM_EDITOR \'s/@GIT_VERSION@/$$LR_VERSION/\' ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
generateversion.CONFIG = no_link target_predeps
QMAKE_EXTRA_COMPILERS += generateversion