"Fancy" version statement (qmake part)

After some highly annoying and time consuming tinkering with quotes and
escaping, the embedding of versioning data seems to work as intended
now.
This commit is contained in:
TheAssassin
2018-01-26 20:37:38 +01:00
parent 84a7f6b37f
commit b3d31bbc84
+16
View File
@@ -15,3 +15,19 @@ SOURCES += main.cpp \
shared.cpp shared.cpp
DEFINES -= QT_USE_QSTRINGBUILDER #leads to compile errors if not disabled DEFINES -= QT_USE_QSTRINGBUILDER #leads to compile errors if not disabled
# versioning
# don't break the quotes -- at the moment, the shell commands are injected into the Makefile to have them run on every
# build and not during configure time
DEFINES += LINUXDEPLOYQT_GIT_COMMIT="'\"$(shell git rev-parse --short HEAD)\"'"
DEFINES += BUILD_DATE="'\"$(shell env LC_ALL=C date -u '+%Y-%m-%d %H:%M:%S %Z')\"'"
equals($$(TRAVIS_BUILD_NUMBER), "") {
DEFINES += BUILD_NUMBER="'\"<local dev build>\"'"
} else {
DEFINES += BUILD_NUMBER="'\"$$(TRAVIS_BUILD_NUMBER)\"'"
}
DEFINES += LINUXDEPLOYQT_VERSION="'\"$(shell git describe --tags $(shell git rev-list --tags --skip=1 --max-count=1) --abbrev=0)\"'"