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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user