forked from aardsoft/emacsbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_info.pri
37 lines (32 loc) · 977 Bytes
/
build_info.pri
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
HEAD_REV=$$system(git rev-parse --short HEAD, blob, ret)
equals(ret, 0){
message("Building from git")
NEWEST_TAG=$$system(git describe --abbrev=0 --tags)
NEWEST_TAG_DIRTY=$$system(git describe --abbrev=0 --tags --dirty="/dirty")
COMMIT_COUNT=$$system(git rev-list $${NEWEST_TAG}.. --count)
TOTAL_COMMIT_COUNT=$$system(git rev-list HEAD --count)
}else{
NEWEST_TAG_DIRTY=""
include(release_version.pri)
message("Building from tarball")
}
DIRTY=$$split(NEWEST_TAG_DIRTY, /)
message("Newest tag: $$NEWEST_TAG")
message("Commits since tag: $$COMMIT_COUNT")
message("Total commits: $$TOTAL_COMMIT_COUNT")
unix {
contains(DIRTY, dirty){
VERSION=$${NEWEST_TAG}.$${COMMIT_COUNT}-dirty
}else{
VERSION=$${NEWEST_TAG}.$${COMMIT_COUNT}
}
}
windows {
contains(DIRTY, dirty){
VERSION=$${NEWEST_TAG}.$${COMMIT_COUNT}.0
}else{
VERSION=$${NEWEST_TAG}.$${COMMIT_COUNT}
}
}
message("Building version $$VERSION")
DEFINES += VERSION="'\"$$VERSION\"'"