diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index c112037b693e9f34142698ea091c8571f23c8f70..6cdaa282b17e4d1a592e9784f347de89cf6f9eb9 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -26,11 +26,16 @@ WindowsBuild { } # -# QUpgrade +# QUpgrade support. # - -exists(qupgrade) { - message(Including support for QUpgrade) +# Allow the user to override QUpgrade compilation through a DISABLE_QUPGRADE +# define like: `qmake DEFINES=DISABLE_QUPGRADE` +contains(DEFINES, DISABLE_QUPGRADE) { + message("Skipping support for QUpgrade (manual override)") +} +# If the QUpgrade submodule has been initialized, build in support by default. +else:exists(qupgrade/.git) { + message("Including support for QUpgrade") DEFINES += QUPGRADE_SUPPORT @@ -58,8 +63,10 @@ exists(qupgrade) { LinuxBuild:CONFIG += qesp_linux_udev include(qupgrade/libs/qextserialport/src/qextserialport.pri) -} else { - message(Skipping support for QUpgrade) +} +# Otherwise notify the user and don't compile it. +else { + message("Skipping support for QUpgrade (missing submodule, see README)") } # diff --git a/README.md b/README.md index d61e2631db2a22b4d1ea890f8d4405b3fd0e3ffb..137fdd5e46b09576cf9f339ee30174324c3df670 100644 --- a/README.md +++ b/README.md @@ -20,19 +20,14 @@ Please make sure to delete your build folder before re-building. Independent of build system you use (this is not related to Qt or your OS) the dependency checking and cleaning is based on the current project revision. So if you change the project and don't remove the build folder before your next build, incremental building can leave you with stale object files. -## QGC2.0 Tech Preview -Developers: In order to build the tech preview branch you need to: +### QUpgrade +QUpgrade is a submodule (a Git feature like a sub-repository) that contains extra functionality. It is compiled in by default if it has initialized and updated. It can be disabled by specifying the DISABLE_QUPGRADE definition when calling qmake `qmake DEFINES=DISABLE_QUPGRADE`. - git clone https://github.com/mavlink/qgroundcontrol -b config qgc2 - git submodule init - git submodule update - -This procedure: - -* Clones the config branch (which contains QGC2) from github into your qgc2 directory -* initializes all the submodules required for QGC, such as qupdate, the firmware installer -* gets the latest code for all submodules +To include QUpgrade functionality run the following (only needs to be done once after cloning the qggroundcontrol git repository): + * `git submodule init` + * `git submodule update` +The QUpgrade module relies on `libudev` on Linux platforms. # Build on Mac OSX diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc index c48fac5d432985c04336317ac581fa5415a8092b..c4f468e5953e75c4b64246a8823c5d2b0c5e04cb 100644 --- a/src/ui/QGCPX4VehicleConfig.cc +++ b/src/ui/QGCPX4VehicleConfig.cc @@ -23,7 +23,10 @@ #include "ui_QGCPX4VehicleConfig.h" #include "px4_configuration/QGCPX4AirframeConfig.h" #include "px4_configuration/QGCPX4SensorCalibration.h" + +#ifdef QUPGRADE_SUPPORT #include +#endif #define WIDGET_INDEX_FIRMWARE 0 #define WIDGET_INDEX_RC 1 @@ -106,7 +109,6 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) : connect(firmwareDialog, SIGNAL(connectLinks()), LinkManager::instance(), SLOT(connectAll())); connect(firmwareDialog, SIGNAL(disconnectLinks()), LinkManager::instance(), SLOT(disconnectAll())); #else -#error Please check out QUpgrade from http://github.com/LorenzMeier/qupgrade/ into the QGroundControl folder. QLabel* label = new QLabel(this); label->setText("THIS VERSION OF QGROUNDCONTROL WAS BUILT WITHOUT QUPGRADE. To enable firmware upload support, checkout QUpgrade WITHIN the QGroundControl folder");