diff --git a/bangolufsen.pro b/bangolufsen.pro index 684877d..4b3140e 100755 --- a/bangolufsen.pro +++ b/bangolufsen.pro @@ -2,10 +2,24 @@ TEMPLATE = lib CONFIG += c++14 plugin QT += websockets core quick -# Plugin VERSION -GIT_HASH = "$$system(git log -1 --format="%H")" -GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)" -GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)" +# === Version and build information =========================================== +# If built in Buildroot use custom package version, otherwise Git +isEmpty(YIO_BUILD_VERSION) { + GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)" + GIT_HASH = "$$system(git log -1 --format="%H")" + GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)" +} else { + GIT_VERSION = $$YIO_BUILD_VERSION + contains(GIT_VERSION, "^v?(0|[1-9]\d*)\..*") { + # (simplified) version string = regular release + GIT_HASH = "" + GIT_BRANCH = "master" + } else { + # git hash as version = custom build + GIT_HASH = $$YIO_BUILD_VERSION + GIT_BRANCH = "" + } +} BO_VERSION = $$replace(GIT_VERSION, v, "") DEFINES += PLUGIN_VERSION=\\\"$$BO_VERSION\\\" @@ -16,6 +30,8 @@ win32 { } else { BUILDDATE=$$system(date +"%Y-%m-%dT%H:%M:%S") } +# ============================================================================= + CONFIG(debug, debug|release) { DEBUG_BUILD = true } else {