Skip to content

Commit

Permalink
Fix up support for Mavlink All dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Nov 15, 2023
1 parent a379bec commit 740397e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
27 changes: 7 additions & 20 deletions QGCExternalLibs.pri
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ isEmpty(MAVLINK_CONF) {
message($$sprintf("Using user-supplied mavlink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
} else {
MAVLINK_CONF = all
message($$sprintf("Using MAVLink dialect '%1'.", $$MAVLINK_CONF))
}
}

Expand All @@ -67,32 +68,18 @@ contains (CONFIG, QGC_DISABLE_APM_MAVLINK) {
CONFIG += ArdupilotEnabled
}

# 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) {
message($$sprintf("Using MAVLink dialect '%1'.", $$MAVLINK_CONF))
}

# Then we add the proper include paths dependent on the dialect.
INCLUDEPATH += $$MAVLINKPATH

exists($$MAVLINKPATH/common) {
!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)
}
count(MAVLINK_CONF, 1) {
exists($$MAVLINKPATH/$$MAVLINK_CONF) {
INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
} else {
INCLUDEPATH += $$MAVLINKPATH/common
error($$sprintf("MAVLink dialect '%1' does not exist at '%2'!", $$MAVLINK_CONF, $$MAVLINKPATH_REL))
}
} else {
error($$sprintf("MAVLink folder does not exist at '%1'! Run 'git submodule init && git submodule update' on the command line.",$$MAVLINKPATH_REL))
error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
}

#
Expand Down
1 change: 0 additions & 1 deletion custom-example/custom.pri
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ DEFINES += APP_VERSION_STR=\"\\\"$$CUSTOM_QGC_VERSION\\\"\"
message(Custom QGC Version: $${CUSTOM_QGC_VERSION})

# Build a single flight stack by disabling APM support
MAVLINK_CONF = common
CONFIG += QGC_DISABLE_APM_MAVLINK
CONFIG += QGC_DISABLE_APM_PLUGIN QGC_DISABLE_APM_PLUGIN_FACTORY

Expand Down

0 comments on commit 740397e

Please sign in to comment.