Fix getting the latest tag distance. #126
This commit is contained in:
parent
1ea8e1baaa
commit
5c8fbbcc59
|
@ -292,7 +292,7 @@ defineReplace(FindBuildRevision){
|
|||
defineReplace(FindLatestTagDistance){
|
||||
CONFIG(debug, debug|release){
|
||||
# Debug mode
|
||||
return(\\\"0\\\")
|
||||
return(0)
|
||||
}else{
|
||||
# Release mode
|
||||
|
||||
|
@ -302,10 +302,10 @@ defineReplace(FindLatestTagDistance){
|
|||
# 3. latest commit is gSHA
|
||||
tag_all = $$system(git describe --tags)
|
||||
tag_split = $$split(tag_all, "-") #split at the dashes
|
||||
GIT_DISTANCE = \\\"$$member(tag_split,1)\\\" #get 2nd element of results
|
||||
GIT_DISTANCE = $$member(tag_split,1) #get 2nd element of results
|
||||
|
||||
isEmpty(GIT_DISTANCE){
|
||||
GIT_DISTANCE = \\\"0\\\" # if we can't find local revision left 0.
|
||||
GIT_DISTANCE = 0 # if we can't find local revision left 0.
|
||||
}
|
||||
|
||||
message("Latest tag distance:" $${GIT_DISTANCE})
|
||||
|
|
|
@ -90,6 +90,6 @@ CONFIG(debug, debug|release){
|
|||
}
|
||||
}
|
||||
|
||||
DEFINES += "LATEST_TAG_DISTANCE=$$FindLatestTagDistance()" # Make available latest tag distance number in sources.
|
||||
DEFINES += LATEST_TAG_DISTANCE=\\\"$$FindLatestTagDistance()\\\" # Make available latest tag distance number in sources.
|
||||
|
||||
include (../libs.pri)
|
||||
|
|
Loading…
Reference in New Issue
Block a user