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
fcdee75e
Commit
fcdee75e
authored
Aug 05, 2015
by
Daniel Agar
Browse files
set QGC version from git
parent
26a6fd79
Changes
7
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
fcdee75e
...
...
@@ -67,3 +67,5 @@ ui_*
*.so*
*.moc
*.prl
git_version.cpp
git_version.obj
QGCApplication.pro
View file @
fcdee75e
...
...
@@ -18,9 +18,10 @@
#
-------------------------------------------------
include
(
QGCCommon
.
pri
)
include
(
git_version
.
pri
)
TARGET
=
qgroundcontrol
TEMPLATE
=
app
TEMPLATE
=
app
#
Load
additional
config
flags
from
user_config
.
pri
exists
(
user_config
.
pri
)
:
infile
(
user_config
.
pri
,
CONFIG
)
{
...
...
git_version.pri
0 → 100644
View file @
fcdee75e
# set the QGC version from git
exists ($$PWD/.git) {
GIT_DESCRIBE = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)
WindowsBuild {
QGC_GIT_VER = echo extern \"C\" { const char *git_version() { return \"$$GIT_DESCRIBE\"; } } > git_version.cpp
LIBS += git_version.obj
} else {
QGC_GIT_VER = echo \"extern \\\"C\\\" { const char *git_version() { return \\\"$$GIT_DESCRIBE\\\"; } }\" > git_version.cpp
LIBS += git_version.o
}
}
WindowsBuild {
LIBS += git_version.obj
} else {
LIBS += git_version.o
}
CONFIG(debug) {
GIT_VERSION_CXXFLAGS = $$QMAKE_CXXFLAGS_DEBUG
} else {
GIT_VERSION_CXXFLAGS = $$QMAKE_CXXFLAGS_RELEASE
}
QMAKE_PRE_LINK += $$QGC_GIT_VER && $$QMAKE_CXX -c $$GIT_VERSION_CXXFLAGS git_version.cpp
qgroundcontrol.pro
View file @
fcdee75e
...
...
@@ -22,6 +22,8 @@ CONFIG += ordered
SUBDIRS
=
.
/
QGCLocationPlugin
.
pro
SUBDIRS
+=
.
/
QGCApplication
.
pro
include
(
git_version
.
pri
)
QGCApplication
.
depends
=
QGCLocationPlugin
message
(
Qt
version
$$
[
QT_VERSION
])
...
...
@@ -30,3 +32,6 @@ message(Qt version $$[QT_VERSION])
error
(
"Unsupported Qt version, 5.4+ is required"
)
}
message
(
QGroundControl
version
$$
{
GIT_DESCRIBE
})
git_ver
.
commands
=
$$
QGC_GIT_VER
QMAKE_EXTRA_TARGETS
+=
git_ver
src/QGCApplication.cc
View file @
fcdee75e
...
...
@@ -48,6 +48,7 @@ GST_PLUGIN_STATIC_DECLARE(QTVIDEOSINK_NAME);
G_END_DECLS
#endif
#include
"git_version.h"
#include
"configuration.h"
#include
"QGC.h"
#include
"QGCApplication.h"
...
...
@@ -251,10 +252,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
setOrganizationName
(
QGC_ORG_NAME
);
setOrganizationDomain
(
QGC_ORG_DOMAIN
);
// Version string is build from component parts. Format is:
// vMajor.Minor.BuildNumber BuildType
QString
versionString
(
"v%1.%2.%3 %4"
);
versionString
=
versionString
.
arg
(
QGC_APPLICATION_VERSION_MAJOR
).
arg
(
QGC_APPLICATION_VERSION_MINOR
).
arg
(
QGC_APPLICATION_VERSION_BUILDNUMBER
).
arg
(
QGC_APPLICATION_VERSION_BUILDTYPE
);
QString
versionString
(
git_version
());
// 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
);
// Set settings format
...
...
src/QGCConfig.h
View file @
fcdee75e
...
...
@@ -18,21 +18,4 @@
#define QGC_ORG_NAME "QGroundControl.org"
#define QGC_ORG_DOMAIN "org.qgroundcontrol"
#define QGC_APPLICATION_VERSION_MAJOR 2
#define QGC_APPLICATION_VERSION_MINOR 7
// The following #definess can be overriden from the command line so that automated build systems can
// add additional build identification.
// Only comes from command line
//#define QGC_APPLICATION_VERSION_COMMIT "..."
#ifndef QGC_APPLICATION_VERSION_BUILDNUMBER
#define QGC_APPLICATION_VERSION_BUILDNUMBER 1
#endif
#ifndef QGC_APPLICATION_VERSION_BUILDTYPE
#define QGC_APPLICATION_VERSION_BUILDTYPE "(Stable)"
#endif
#endif // QGC_CONFIGURATION_H
src/git_version.h
0 → 100644
View file @
fcdee75e
extern
"C"
{
const
char
*
git_version
();
}
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