summaryrefslogtreecommitdiffstats
path: root/subsurface-gen-version.pri
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-02 15:26:43 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-02 18:31:42 -0800
commiteba18ff5e9096f09db54ef348c54e671a7094c72 (patch)
treedb1d191e91144d1f5f419074581cac6060bc56c8 /subsurface-gen-version.pri
parenta1cd2306255a3a3bdcd47ffd11af884df7ed331c (diff)
downloadsubsurface-eba18ff5e9096f09db54ef348c54e671a7094c72.tar.gz
Ubuntu packaging: get git version without including the full git tree
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-gen-version.pri')
-rw-r--r--subsurface-gen-version.pri8
1 files changed, 6 insertions, 2 deletions
diff --git a/subsurface-gen-version.pri b/subsurface-gen-version.pri
index 67bcdd761..23d86570a 100644
--- a/subsurface-gen-version.pri
+++ b/subsurface-gen-version.pri
@@ -22,7 +22,11 @@ exists(.git/HEAD): {
QMAKE_EXTRA_COMPILERS += version_h
} else {
# This is probably a package
- FULL_VERSION = $$VERSION
- system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$VERSION\\\" > $$VERSION_FILE)
+ exists(.gitversion): {
+ FULL_VERSION = $$system("cat .gitversion")
+ } else {
+ FULL_VERSION = $$VERSION
+ }
+ system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$FULL_VERSION\\\" > $$VERSION_FILE)
QMAKE_CLEAN += $$VERSION_FILE
}