Skip to content

Commit

Permalink
Use git tag as application version
Browse files Browse the repository at this point in the history
  • Loading branch information
gsurkov committed Aug 11, 2021
1 parent fa72d03 commit 03a450c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions application/application.pro
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
QT += quick serialport widgets quickcontrols2 svg

TARGET = qFlipper
VERSION = 0.1
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

GIT_VERSION = $$system("git describe --tags --abbrev=0","lines", HAS_VERSION)

equals(HAS_VERSION, 0) {
RC_SUFFIX = -rc

contains(GIT_VERSION, .*$$RC_SUFFIX) {
# Remove -rc suffix as it isn't allowed in Windows manifest
VERSION = $$str_member($$GIT_VERSION, 0, $$num_add($$str_size($$GIT_VERSION), -$$num_add($$str_size($$RC_SUFFIX), 1)))
} else {
VERSION = $$GIT_VERSION
}

} else {
VERSION = 0.0.0
GIT_VERSION = unknown
}

DEFINES += APP_VERSION=\\\"$$GIT_VERSION\\\"
DESTDIR = ..

CONFIG += c++11
Expand Down

0 comments on commit 03a450c

Please sign in to comment.