From 5c8fbbcc59bd77f0165f593ebc200eaf129815fd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 13 May 2021 21:38:24 +0300 Subject: [PATCH] Fix getting the latest tag distance. #126 --- common.pri | 6 +++--- src/libs/vmisc/vmisc.pro | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common.pri b/common.pri index cbc8df716..88e7738b8 100644 --- a/common.pri +++ b/common.pri @@ -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}) diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro index 38e39515b..eb0333d8e 100644 --- a/src/libs/vmisc/vmisc.pro +++ b/src/libs/vmisc/vmisc.pro @@ -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)