Read version from Git

master
adrido 2015-07-20 08:44:41 +02:00
parent 0ab34eecb2
commit fb50ebbaf7
2 changed files with 18 additions and 12 deletions

View File

@ -31,20 +31,26 @@ RESOURCES += \
TRANSLATIONS = languages/gui_de.ts\
languages/gui_en.ts
#Application version
VERSION_MAJOR = 0
VERSION_MINOR = 4
VERSION_BUILD = 3
DEFINES += "VERSION_MAJOR=$$VERSION_MAJOR"\
"VERSION_MINOR=$$VERSION_MINOR"\
"VERSION_BUILD=$$VERSION_BUILD"
GIT_VERSION = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)
#something like 0.4.2-55-g123c456
isEmpty(GIT_VERSION) {
GIT_VERSION = 0.5.0
}
# Turns describe output like 0.4.2-55-g652c397 into "0.4.2.55.123c456"
GIT_VERSION ~= s/-/"."
GIT_VERSION ~= s/g/""
#Target version
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_BUILD}
DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
VERSION = $$GIT_VERSION
win32 {
VERSION ~= s/\.[a-f0-9]{6,}//
#something like 0.4.2.55
}
RC_ICONS = images/icon.ico
RC_LANG = 0x0407
RC_LANG = 0x04b0
QMAKE_TARGET_PRODUCT = "Minetest Mappger GUI"
QMAKE_TARGET_DESCRIPTION = "Graphical user interface for MinetestMapper"

View File

@ -856,11 +856,11 @@ void MainWindow::on_actionAbout_MinetestMapperGUI_triggered()
tr("<h1>About MinetestMapperGUI</h1>"
"The <b>MinetestMapper Gui</b> is written by addi.<br />"
"It is licensed under a <a href=\"http://creativecommons.org/licenses/by/3.0/\">Creative Commons Attribution 3.0 Unported License</a>.<br>"
"The current version is %1.%2.%3. <br>"
"The current version is %1. <br>"
"The sourcecode is aviable on <a href='https://bitbucket.org/adrido/minetestmappergui/'>Bitbucket</a>.<br>"
"You may also want to read the <a href='https://forum.minetest.net/viewtopic.php?f=14&t=12139'>Minetest forum thread</a>.<br><br>"
"<b>Thanks to:</b><br>"
"McKrustenkaese for his great icon").arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_BUILD));
"McKrustenkaese for his great icon").arg(GIT_VERSION));
}