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
b8a37e39
Commit
b8a37e39
authored
Mar 17, 2014
by
Don Gagne
Browse files
Merge pull request #594 from DonLakeFlyer/Issue570
Only a single MAVLink dialect is supported
parents
4574fd52
969c5aea
Changes
2
Hide whitespace changes
Inline
Side-by-side
QGCExternalLibs.pri
View file @
b8a37e39
...
...
@@ -78,10 +78,9 @@ else {
# the selected autopilot system.
#
# If the user config file exists, it will be included. If this file
# specifies the MAVLINK_CONF variable with a list of MAVLink
# dialects, support for them will be compiled in to QGC. It will also
# create a QGC_USE_{AUTOPILOT_NAME}_MESSAGES macro for use within
# the actual code.
# specifies the MAVLINK_CONF variable with a MAVLink dialect, support
# for it will be compiled in to QGC. It will also create a
# QGC_USE_{AUTOPILOT_NAME}_MESSAGES macro for use within the actual code.
#
MAVLINKPATH_REL = libs/mavlink/include/mavlink/v1.0
MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL
...
...
@@ -90,52 +89,37 @@ DEFINES += MAVLINK_NO_DATA
# First we select the dialect, checking for valid user selection
# Users can override all other settings by specifying MAVLINK_CONF as an argument to qmake
!isEmpty(MAVLINK_CONF) {
for(dialect, MAVLINK_CONF) {
exists($$MAVLINKPATH/$$dialect) {
MAVLINK_DIALECTS += $$dialect
message($$sprintf("Using MAVLink dialect '%1' specified at the command line.", $$dialect))
} else {
error($$sprintf("MAVLink dialect '%1' specified at the command line does not exist at '%2'!", $$dialect, $$MAVLINKPATH_REL))
}
}
message($$sprintf("Using MAVLink dialect '%1' specified at the command line.", $$MAVLINK_CONF))
}
# Otherwise they can specify MAVLINK_CONF within user_config.pri
else:infile(user_config.pri, MAVLINK_CONF) {
MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF)
!isEmpty(MAVLINK_CONF) {
for(dialect, MAVLINK_CONF) {
exists($$MAVLINKPATH/$$dialect) {
MAVLINK_DIALECTS += $$dialect
message($$sprintf("Using MAVLink dialect '%1' specified in user_config.pri", $$dialect))
} else {
error($$sprintf("MAVLink dialect '%1' specified in user_config.pri does not exist at '%2'!", $$dialect, $$MAVLINKPATH_REL))
}
}
message($$sprintf("Using MAVLink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
}
}
# If no valid user selection is found, default to the ardupilotmega if it's available.
# Note: This can be a list of several dialects.
else {
DEFAULT_MAVLINK_DIALECTS=ardupilotmega
for(dialect, DEFAULT_MAVLINK_DIALECTS) {
exists($$MAVLINKPATH/$$dialect) {
MAVLINK_DIALECTS += $$dialect
message($$sprintf("Using default MAVLink dialect '%1'.", $$dialect))
} else {
warning($$sprintf("Default MAVLink dialect '%1' does not exist at '%2'!", $$dialect, $$MAVLINKPATH_REL))
}
}
MAVLINK_CONF=ardupilotmega
message($$sprintf("Using default MAVLink dialect '%1'.", $$MAVLINK_CONF))
}
# Then we add the proper include paths dependent on the dialects and notify
#
t
he
user of the current
dialect.
#
T
he
n we add the proper include paths dependent on the
dialect.
INCLUDEPATH += $$MAVLINKPATH
!isEmpty(MAVLINK_DIALECTS) {
for(dialect, MAVLINK_DIALECTS) {
INCLUDEPATH += $$MAVLINKPATH/$$dialect
DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$dialect))
!isEmpty(MAVLINK_CONF) {
count(MAVLINK_CONF, 1) {
exists($$MAVLINKPATH/$$MAVLINK_CONF) {
INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
} else {
error($$sprintf("MAVLink dialect '%1' does not exist at '%2'!", $$MAVLINK_CONF, $$MAVLINKPATH_REL))
}
} else {
error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
}
} else {
warning("No
valid
MAVLink dialect
s foun
d, only common messages supported.")
warning("No MAVLink dialect
specifie
d, only common messages supported.")
INCLUDEPATH += $$MAVLINKPATH/common
}
...
...
user_config.pri.dist
View file @
b8a37e39
...
...
@@ -23,10 +23,10 @@
#
#-------------------------------------------------
# Specify MAVLink dialect
s
to compile support for here. This variable is processed
# by QGCExternalLibs.pri, which handles MAVLink configuration.
#
To specify dialects
to include
set MAVLINK_CONF to a space-separated list of dialects.
#
Each dialect should correspond to an include folder under `libs/mavlink/include`
# Specify
the
MAVLink dialect to compile support for here. This variable is processed
# by QGCExternalLibs.pri, which handles MAVLink configuration.
The dialect should
#
correspond
to
an
include
folder under `libs/mavlink/include/mavlink/v1.0`. You can
#
also force a build to use only common mavlink message by setting MAVLINK_CONF to empty here.
#MAVLINK_CONF = pixhawk
# Override compilation of QGroundControl's features in your build. This overrides the default
...
...
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