Commit 2a7dc76e authored by Bryant's avatar Bryant

Allow for enabling/disabling features and specifying MAVLink dialects from user_config.pri.

Settings in user_config.pri are overridden by those specified at the command line when calling qmake.
Also updated the README and user_config.pri.dist to be a little more clear about specifying these other options.
parent bd3b7cc8
......@@ -29,9 +29,13 @@ WindowsBuild {
# 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)")
message("Skipping support for QUpgrade (manual override from command line)")
DEFINES -= DISABLE_QUPGRADE
}
# Otherwise the user can still disable this feature in the user_config.pri file.
else:infile(user_config.pri, DEFINES, DISABLE_QUPGRADE) {
message("Skipping support for QUpgrade (manual override from user_config.pri)")
}
# If the QUpgrade submodule has been initialized, build in support by default.
else:exists(qupgrade/.git) {
message("Including support for QUpgrade")
......@@ -96,8 +100,8 @@ DEFINES += MAVLINK_NO_DATA
}
}
# Otherwise they can specify MAVLINK_CONF within user_config.pri
else:exists(user_config.pri) {
include(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) {
......@@ -140,7 +144,13 @@ INCLUDEPATH += $$MAVLINKPATH
# Replaced by mavgenerator.py within the MAVLink project.
#
contains(DEFINES, ENABLE_MAVGEN) {
warning("Including support for MAVLink generator GUI (caution: deprecated)")
warning("Including support for MAVLink generator GUI (manual override from command line, CAUTION: deprecated)")
} else:infile(user_config.pri, DEFINES, ENABLE_MAVGEN) {
DEFINES += ENABLE_MAVGEN # infile doesn't automatically include everything in the specified file
warning("Including support for MAVLink generator GUI (manual override from user_config.pri, CAUTION: deprecated)")
}
contains(DEFINES, ENABLE_MAVGEN) {
# Rename the macro to be consistent with other QGC feature existance macros.
DEFINES -= ENABLE_MAVGEN
DEFINES += QGC_MAVGEN_ENABLED
......@@ -159,8 +169,17 @@ contains(DEFINES, ENABLE_MAVGEN) {
#
# [OPTIONAL] OpenSceneGraph
#
MacBuild {
# Allow the user to override OpenSceneGraph compilation through a DISABLE_OPEN_SCENE_GRAPH
# define like: `qmake DEFINES=DISABLE_OPEN_SCENE_GRAPH`
contains(DEFINES, DISABLE_OPEN_SCENE_GRAPH) {
message("Skipping support for OpenSceneGraph (manual override from command line)")
DEFINES -= DISABLE_OPEN_SCENE_GRAPH
}
# Otherwise the user can still disable this feature in the user_config.pri file.
else:infile(user_config.pri, DEFINES, DISABLE_OPEN_SCENE_GRAPH) {
message("Skipping support for OpenSceneGraph (manual override from user_config.pri)")
}
else:MacBuild {
# GLUT and OpenSceneGraph are part of standard install on Mac
message("Including support for OpenSceneGraph")
CONFIG += OSGDependency
......@@ -267,8 +286,12 @@ OSGDependency {
# Only supported on Mac and Windows where Google Earth can be installed.
#
contains(DEFINES, DISABLE_GOOGLE_EARTH) {
message("Skipping support for Google Earth view (manual override)")
message("Skipping support for Google Earth view (manual override from command line)")
DEFINES -= DISABLE_GOOGLE_EARTH
}
# Otherwise the user can still disable this feature in the user_config.pri file.
else:infile(user_config.pri, DEFINES, DISABLE_GOOGLE_EARTH) {
message("Skipping support for Google Earth view (manual override from user_config.pri)")
} else:MacBuild {
message("Including support for Google Earth view")
DEFINES += QGC_GOOGLE_EARTH_ENABLED
......@@ -318,8 +341,11 @@ LinuxBuild : contains(MAVLINK_DIALECT, pixhawk) {
# [OPTIONAL] Kinect support using libfreenect on POSIX systems.
#
contains(DEFINES, DISABLE_KINECT) {
message("Skipping support for the Kinect (manual override)")
message("Skipping support for the Kinect (manual override from command line)")
DEFINES -= DISABLE_KINECT
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_KINECT) {
message("Skipping support for the Kinext (manual override from user_config.pri)")
} else:MacBuild | LinuxBuild {
exists(/opt/local/include/libfreenect) | exists(/usr/local/include/libfreenect) {
message("Including support for the Kinect")
......@@ -390,8 +416,11 @@ XBEE_DEPENDENT_SOURCES += \
XBEE_DEFINES = QGC_XBEE_ENABLED
contains(DEFINES, DISABLE_XBEE) {
message("Skipping support for native XBee API (manual override)")
message("Skipping support for native XBee API (manual override from command line)")
DEFINES -= DISABLE_XBEE
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_XBEE) {
message("Skipping support for native XBee API (manual override from user_config.pri)")
} else:LinuxBuild {
exists(/usr/include/xbee.h) {
message("Including support for XBee API")
......@@ -418,8 +447,11 @@ contains(DEFINES, DISABLE_XBEE) {
# [OPTIONAL] Magellan 3DxWare library. Provides support for 3DConnexion's 3D mice.
#
contains(DEFINES, DISABLE_3DMOUSE) {
message("Skipping support for 3DConnexion mice (manual override)")
message("Skipping support for 3DConnexion mice (manual override from command line)")
DEFINES -= DISABLE_3DMOUSE
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_3DMOUSE) {
message("Skipping support for 3DConnexion mice (manual override from user_config.pri)")
} else:LinuxBuild {
exists(/usr/local/lib/libxdrvlib.so) {
message("Including support for 3DConnexion mice")
......@@ -459,8 +491,11 @@ contains(DEFINES, DISABLE_3DMOUSE) {
# [OPTIONAL] Opal RT-LAB Library. Provides integration with Opal-RT's RT-LAB simulator.
#
contains(DEFINES, DISABLE_RTLAB) {
message("Skipping support for RT-LAB (manual override)")
message("Skipping support for RT-LAB (manual override from command line)")
DEFINES -= DISABLE_RTLAB
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_RTLAB) {
message("Skipping support for RT-LAB (manual override from user_config.pri)")
} else:WindowsBuild {
exists(src/lib/opalrt/OpalApi.h) : exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) {
message("Including support for RT-LAB")
......@@ -533,8 +568,11 @@ MacBuild {
# Windows is supported as of Windows 7
#
contains (DEFINES, DISABLE_SPEECH) {
message("Skipping support for speech output (manual override)")
message("Skipping support for speech output (manual override from command line)")
DEFINES -= DISABLE_SPEECH
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_SPEECH) {
message("Skipping support for speech output (manual override from user_config.pri)")
} else:LinuxBuild {
exists(/usr/include/flite) | exists(/usr/local/include/flite) {
message("Including support for speech output")
......
......@@ -21,54 +21,46 @@ build system you use (this is not related to Qt or your OS) the dependency check
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.
## Additional functionality
QGroundcontrol has functionality that is dependent on the operating system and libraries installed by the user. The following sections describe these features, their dependencies, and how to disable/alter them during the build process.
QGroundcontrol has functionality that is dependent on the operating system and libraries installed by the user. The following sections describe these features, their dependencies, and how to disable/alter them during the build process. These features can be forcibly enabled/disabled by specifying additional values for variables either at the command line when calling `qmake` or in the `user_config.pri`. When calling `qmake` additional variables can be set using the syntax `VARIABLE="SPACE_SEPARATED_VALUES"`, which can be repeated for multiple variables. For example: `qmake DEFINES="DISABLE_QUPGRADE DISABLE_SPEECH" MAVLINK_CONF="sensesoar"` disables the QUpgrade widget, speech functionality, and sets the MAVLink dialect to sensesoar. These values can be more permanently specified by setting them in the `user_config.pri` file in the root directly. Copy the `user_config.pri.dist` file and name the copy `user_config.pri`, uncommenting the lines with the variables to modify and set their values as you desire.
**NOTE:** Any variables specified at the command line call to `qmake` will override those set in `user_config.pri`.
### 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`. Note that multiple defines can be specified like this: `qmake DEFINES="DISABLE_QUPGRADE DISABLE_SPEECH"`.
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 `DISABLE_QUPGRADE` in the `DEFINES` variable.
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.
The QUpgrade module relies on `libudev` on Linux platforms, so be sure to install the development version of that package.
### Specifying MAVLink dialects
The MAVLink dialect compiled by default by QGC is for the ardupilotmega. This will happen if no other dialects are specified. To override this create a `user_config.pri` file in the root directory and set the `MAVLINK_CONF` variable using qmake's variable notation syntax: `MAVLINK_CONF=sensesoar`. This variable can be a list of dialects that should all be supported like `MAVLINK_CONF=sensesoar ardupilotmega`. Note that doing this may result in compilation errors as certain dialects may conflict with each other!
The `MAVLINK_CONF` variable can also be specified at the command line as an argument to qmake to allow for easy one-off compilations: `qmake MAVLINK_CONF="sensesoar ardupilotmega"`
The MAVLink dialect compiled by default by QGC is for the ardupilotmega. This will happen if no other dialects are specified. Setting the `MAVLINK_CONF` variable sets the dialects, with more than one specified in a space-separated list. Note that doing this may result in compilation errors as certain dialects may conflict with each other!
### MAVLink dialect generator
An add-on is available for QGC that provides a UI for generating MAVLink dialects from within QGC. This feature has been deprecated since identical functionality now exists within the MAVLink project itself.
This is not built by default as it is deprecated functionality that will removed in a forthcoming version of QGC. You can enable it by specifying the ENABLE_MAVGEN constant as an argument to qmake like `qmake DEFINES=ENABLE_MAVGEN`.
An add-on is available for QGC that provides a UI for generating MAVLink dialects from within QGC. This feature has been deprecated since identical functionality now exists within the MAVLink project itself. Enable this functionality by specifying the `DEFINES` variable `ENABLE_MAVGEN`.
### Opal-RT's RT-LAB simulator
Integration with Opal-RT's RT-LAB simulator can be enabled on Windows by installing RT-LAB 7.2.4. Thallows vehicles to be simulated in RT-LAB and communicate directly with QGC on the same computer as if the UAS was actually deployed.
This support is enabled by default once the requisite RT-LAB software is installed. Disabling this can be done by defining DISABLE_RTLAB when running qmake.
Integration with Opal-RT's RT-LAB simulator can be enabled on Windows by installing RT-LAB 7.2.4. This allows vehicles to be simulated in RT-LAB and communicate directly with QGC on the same computer as if the UAS was actually deployed. This support is enabled by default once the requisite RT-LAB software is installed. Disabling this can be done by adding `DISABLE_RTLAB` to the `DEFINES` variable.
### Speech syntehsis
QGroundcontrol can notify the controller of information via speech synthesis. This requires the `flite` library on Linux. On Mac and Windows support is built in to the OS as of OS X 10.6 (Snow Leopard) and Windows Vista. This support is enabled by default on all platforms if the dependencies are met. Disabling this functionality can be done by adding the `DISABLE_SPEECH` define when running `qmake` like: `qmake DEFINES=DISABLE_SPEECH`. Note that multiple defines can be specified like this: `qmake DEFINES="DISABLE_QUPGRADE DISABLE_SPEECH"`.
QGroundcontrol can notify the controller of information via speech synthesis. This requires the `flite` library on Linux. On Mac and Windows support is built in to the OS as of OS X 10.6 (Snow Leopard) and Windows Vista. This support is enabled by default on all platforms if the dependencies are met. Disabling this functionality can be done by adding `DISABLE_SPEECH` to the `DEFINES` variable.
### 3D view
The OpenSceneGraph libraries provide 3D rendering to the map overlays that QGC can provide.
OpenSceneGraph support is built-in to Mac OS X. On Linux it is commonly available through the libopenscenegraph and libopenscenegraph-qt developer packages. Windows support does not currently exist. This functionality with be automatically built if the proper libraries are installed.
OpenSceneGraph support is built-in to Mac OS X. On Linux it is commonly available through the libopenscenegraph and libopenscenegraph-qt developer packages. Windows support does not currently exist. This functionality with be automatically built if the proper libraries are installed. Disabling this feature can be done by adding `DISABLE_OPEN_SCENE_GRAPH` to the `DEFINES` variable.
### Kinect support
Microsoft's Kinect can be used by some autopilots for additional functionality. This is provided by the libfreenect libraries available on the Mac and Linux platforms.
This support is enabled by default and built-in when the appropriate libraries exist. To disable this behavior set the DISABLE_KINECT define when running qmake.
Microsoft's Kinect can be used by some autopilots for additional functionality. This is provided by the libfreenect libraries available on the Mac and Linux platforms. This support is enabled by default and built-in when the appropriate libraries exist. To disable this behavior add `DISABLE_KINECT` to the `DEFINES` variable.
### 3D mouse support
Connexion's 3D mice are supported through the 3DxWARE driver available on Linux and Windows. Download and install the driver from 3DConnexion to enable support.
This support is enabled by default with driver installation. To disable define DISABLE_3DMOUSE when running qmake.
Connexion's 3D mice are supported through the 3DxWARE driver available on Linux and Windows. Download and install the driver from 3DConnexion to enable support. This support is enabled by default with driver installation. To disable add `DISABLE_3DMOUSE` to the `DEFINES` variable.
### XBee support
QGroundControl can talk to XBee wireless devices using their proprietary protocol directly on Windows and Linux platforms. This support is not necessary if you're not using XBee devices or aren't using their proprietary protocol. On Windows, the necessary dependencies are included in this repository and no additional steps are required. For Linux, change to the `libs/thirdParty/libxbee` folder and run `make;sudo make install` to install libxbee on your system (uninstalling can be done with a `sudo make uninstall`). qmake will automatically detect the library on Linux, so no other work is necessary.
QGroundControl can talk to XBee wireless devices using their proprietary protocol directly on Windows and Linux platforms. This support is not necessary if you're not using XBee devices or aren't using their proprietary protocol. On Windows, the necessary dependencies are included in this repository and no additional steps are required. For Linux, change to the `libs/thirdParty/libxbee` folder and run `make;sudo make install` to install libxbee on your system (uninstalling can be done with a `sudo make uninstall`). `qmake` will automatically detect the library on Linux, so no other work is necessary.
To disable XBee support you may specify `DISABLE_XBEE` in the DEFINES argument to qmake like `qmake DEFINES=DISABLE_XBEE`. Multiple options may be specified for `DEFINES` like: `qmake DEFINES="DISABLE_XBEE DISABLE_SPEECH".
To disable XBee support you may add `DISABLE_XBEE` to the DEFINES argument.
# Build on Mac OSX
......
......@@ -23,11 +23,14 @@
#
#-------------------------------------------------
# Add or remove custom message specs here. The matching mavlink headers are
# included in the main qgroundcontrol.pro file.
MAVLINK_CONF += pixhawk
# slugs \
# ualberta
# Specify MAVLink dialects 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`
#MAVLINK_CONF = pixhawk
# Override compilation of QGroundControl's features in your build. This overrides the default
# options for QGroundControl. To see what those are, refer to README.md.
# This should be a space-separated list of the constants specified in README.md.
# Uncomment the following line and replace DISABLE_XBEE with any features to override.
#DEFINES = DISABLE_XBEE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment