Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
57b381cf
Commit
57b381cf
authored
Jul 09, 2016
by
Daniel Agar
Browse files
update version from git
parent
09493831
Changes
2
Hide whitespace changes
Inline
Side-by-side
QGCCommon.pri
View file @
57b381cf
...
...
@@ -100,27 +100,38 @@ MobileBuild {
exists ($$PWD/.git) {
GIT_DESCRIBE = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)
GIT_HASH = $$system(git rev-parse HEAD)
GIT_BRANCH = $$system(git --git-dir $$PWD/.git --work-tree $$PWD rev-parse --abbrev-ref HEAD)
GIT_HASH = $$system(git --git-dir $$PWD/.git --work-tree $$PWD rev-parse --short HEAD)
GIT_TIME = $$system(git --git-dir $$PWD/.git --work-tree $$PWD show --oneline --format=\"%ci\" -s HEAD)
# determine if we're on a tag matching vX.Y.Z (stable release)
GIT_TAG = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --exact-match --tags HEAD)
contains(GIT_TAG, v[0-9].[0-9].[0-9]) {
# release version "vX.Y.Z"
GIT_VERSION = $${GIT_DESCRIBE}
} else {
# development version "Development branch:sha date"
GIT_VERSION = "Development $${GIT_BRANCH}:$${GIT_HASH} $${GIT_TIME}"
}
VERSION = $$replace(GIT_DESCRIBE, "v", "")
VERSION = $$replace(VERSION, "-", ".")
VERSION = $$section(VERSION, ".", 0, 3)
MacBuild {
MAC_VERSION = $$section(VERSION, ".", 0, 2)
MAC_BUILD = $$section(VERSION, ".", 3, 3)
message(QGroundControl version $${MAC_VERSION} build $${MAC_BUILD} describe $${GIT_
DESCRIBE} hash $${GIT_HASH
})
message(QGroundControl version $${MAC_VERSION} build $${MAC_BUILD} describe $${GIT_
VERSION
})
} else {
message(QGroundControl version $${VERSION} describe $${GIT_
DESCRIBE} hash $${GIT_HASH
})
message(QGroundControl version $${VERSION} describe $${GIT_
VERSION
})
}
} else {
GIT_DESCRIBE = None
GIT_HASH = None
GIT_VERSION = None
VERSION = 0.0.0 # Marker to indicate out-of-tree build
MAC_VERSION = 0.0.0
MAC_BUILD = 0
}
DEFINES += GIT_TAG=\"\\\"$$GIT_DESCRIBE\\\"\"
DEFINES += GIT_HASH=\"\\\"$$GIT_HASH\\\"\"
DEFINES += GIT_VERSION=\"\\\"$$GIT_VERSION\\\"\"
DEFINES += EIGEN_MPL2_ONLY
# Installer configuration
...
...
src/QGCApplication.cc
View file @
57b381cf
...
...
@@ -274,13 +274,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
setOrganizationName
(
QGC_ORG_NAME
);
setOrganizationDomain
(
QGC_ORG_DOMAIN
);
QString
versionString
(
GIT_TAG
);
// stable versions are on tags (v1.2.3)
// development versions are full git describe versions (v1.2.3-18-g879e8b3)
if
(
versionString
.
length
()
>
8
)
{
versionString
.
append
(
" (Development)"
);
}
this
->
setApplicationVersion
(
versionString
);
this
->
setApplicationVersion
(
QString
(
GIT_VERSION
));
// Set settings format
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment