From 29ef19a687c5129d3c2ce9e78d438a4f933c9322 Mon Sep 17 00:00:00 2001 From: Bryant <bwmairs@ucsc.edu> Date: Thu, 30 Jan 2014 19:57:19 -0800 Subject: [PATCH] Updating QUpgrade build process. Now properly checks for if QUpgrade submodule has been cloned. Allows for disabled QUpgrade compilation. Altered some code so that compiling without the QUpgrade module could succeed. Updated README about QUpgrade submodule. --- QGCExternalLibs.pri | 19 +++++++++++++------ README.md | 17 ++++++----------- src/ui/QGCPX4VehicleConfig.cc | 4 +++- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index c112037..6cdaa28 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 d61e263..137fdd5 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 c48fac5..c4f468e 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 <dialog_bare.h> +#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");