Build from Source

This guide explains how to build QGroundControl from source code.

Important: Be sure that you have already installed the Qt 4.7/4.8 (or later) toolchain and other dependencies (see Qt and Dependencies Installation).

1) Download

1a) Download the QGroundControl Code

There are three ways to obtain the QGroundControl source code from our GitHub repository. You can either download a snapshot of the code in a ZIP file, clone the repository, or fork the repository if you plan to contribute to development. If you prefer one of the last two options you will need Git installed on your system; goto GitHub Help and see Set Up Git.

ii) Clone the Repository

This option assumes that you have Git already. To clone (checkout) the QGC repository, run the following command in the directory that you want the qgroundcontrol folder to be created:

git clone git://github.com/mavlink/qgroundcontrol.git
cd qgroundcontrol
git submodule init
git submodule update

iii) Fork the Repository

If you plan to contribute to the development of QGC, you will want this option, which also requires that you have Git set up. To fork the QGC repository, do the following:

1b) Initialize submodules

git submodule init
git submodule update

2) Compile

2a) Windows: Visual Studio 2010

To compile the QGC project for Visual Studio 2010 on Windows, open the Qt Command Prompt:

StartAll ProgramsQt by Nokia vxxx (VS2010 OpenSource)Qt 4.x.x Command Prompt

An the prompt, change into the directory where you put the QGroundControl source and run QMake to create the Visual Studio 2010 project file:

cd C:\mav\qgroundcontrol
qmake -tp vc qgroundcontrol.pro

Note: Re-run QMake on every change to the Qt project files (qgroundcontrol.pro, qgroundcontrol.pri, userconfig.pri). OR WHEN YOU PULL AN UPDATE VIA GIT

Next, start Visual Studio 2010 and load the newly generated project:

FileOpenProject/Solution

Choose the 'qgroundcontrol.vcxproj' file that is generated by 'qmake' in the QGC source directory, and build the solution:

BuildBuild Solution

2b) Linux: GCC

You have 2 options for compiling: the command line or the QT Creator IDE

i) Command Line

qmake
make

ii) Qt Creator

To compile the software, start the Qt Creator IDE (in the applications menu of your operating system). In Qt Creator, go to:

FileOpen → Navigate to the folder where you placed the QGroundControl source → Open the file 'qgroundcontrol.pro'. Then hit the green play button on the bottom left. The code will take approximately 10 minutes to compile.

Mac OS X: Homebrew

Make sure to have Qt installed.

brew install qt

Then build from source and DEBUG (release below):

cd qgroundcontrol
qmake -spec macx-llvm
make -j8

Build the installer config for decent execution performance.

cd qgroundcontrol
qmake -spec macx-llvm CONFIG+=installer
make -j8

The executable (qgroundcontrol.app) will be located in qgroundcontrol/release. Enjoy!

2c) Mac OS X: Clang

To compile the software, start the Qt Creator IDE (in the applications menu of your operating system). In Qt Creator, go to:

FileOpen → Navigate to the folder where you placed the QGroundControl source → Open the file 'qgroundcontrol.pro'.

Then hit the green play button on the bottom left. The code will take approximately 10 minutes to compile.

3) Run

An executable should have been generated in the 'debug' folder of your QGC source directory and can be run normally.