QGroundControl 소스 코드를 가져와 기본적으로 빌드하는 방법을 설명합니다.
Source Code
$ git clone --recursive -j8 https://github.com/mavlink/qgroundcontrol.git
Build QGC
QGC(2023.06.19, qgc v4.2.6)는 QT 5.15.2를 대상으로 테스트되었으며, 그외 버전은 정식으로 지원하지 않습니다.
Do not use any other version of Qt! QGC has been thoroughly tested with the specified version of Qt (5.15.2). There is a significant risk that other Qt versions will inject bugs that affect stability and safety (even if QGC compiles).
Using Containers
Linux Conntainer 이미지로
제공되는 Docker 파일을 이용하여 별도의 설치 없이 빌드 및 배포를 수행 할 수 있습니다.
(해당 Docker 파일은 Ubuntu 20.04로 구성되어 있습니다.)
To install :
- Docker 다운로드 및 설치
- Docker 이미지 생성
> cd qgroundcontrol > docker build --file ./deploy/docker/Dockerfile-build-linux -t qgc-linux-docker .
- Build
1) 다운로드한 레포지토리 폴더로 이동
shell $ cd qgroundcontrol
2) 빌드를 수행할 디렉토리를 생성하고 이미지 실행shell > docker run --rm -v ${PWD}:/project/source -v ${PWD}/build:/project/build qgc-linux-docker
Native Build
macOS, Linux, Windows, iOS 및 Android의 빌드를 지원합니다.
- macOS: v10.11 or higher
- Ubuntu: 64 bit, gcc compiler
- Windows: Vista or higher, Visual Studio 2019 compiler (64 bit)
- iOS: 10.0 and higher
- Android: Jelly Bean (4.1) and higher.
MSVC 설치(Windows Only)
윈도우 환경에서는 Visual Studio 2019 Compiler(64bit)로 컴파일을 수행합니다.
Desktop development whth C++를 선택하여 설치를 진행합니다.
QT 설치
- Qt Installer를 다운로드 받습니다.
The Qt Company offering changes, open source offline installers are not available any more since Qt 5.15. Read more about offering changes in the https://www.qt.io/blog/qt-offering-changes-2020 blog. If you need offline installers, please consider our new Qt for Small Business offering: https://www.qt.io/blog/available-now-qt-for-small-businesses
- QT를 설치합니다.
$ ./qt-unified-linux-x64-4.6.0-online.run
기본적으로 최신 버전만 선택할 수 있습니다.
Archive를 체크 후 Filter 버튼을 클릭하여 이전 버전을 불러옵니다.
build
CLI에서 qmake를 사용하여 빌드
1) 다운로드한 레포짘토리 폴더로 이동
$ cd qgroundcontrol
2) 빌드를 수행한 디렉토리를 생성하고 이동
$ mkdir build
$ cd build
3) qmake 스크립트를 사용하여 빌드 구성
$ qmake ../
4) make를 실행하여 컴파일(-j{number of threads} )
make -j12
Run
$ ./staging/QGroundControl
TroubleShooting
[Ubuntu 환경]
- QT 버전 변경
$ vi /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf
/opt/QT/5.15.2/gcc_64/bin
/usr/lib/x86_64-linux-gnu - Not found airmap
ompiling /home/ubuntu/Documents/qgroundcontrol/src/QGCToolbox.cc In file included from /home/ubuntu/Documents/qgroundcontrol/src/Airmap/AirMapSharedState.h:17, from /home/ubuntu/Documents/qgroundcontrol/src/Airmap/AirMapManager.h:12, from /home/ubuntu/Documents/qgroundcontrol/src/QGCToolbox.cc:38: /home/ubuntu/Documents/qgroundcontrol/src/Airmap/services/client.h:4:10: fatal error: airmap/client.h: No such file or directory 4 | #include <airmap/client.h> | ^~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:260800: QGCToolbox.o] Error 1 07:52:49: The process "/usr/bin/make" exited with code 2. Error while building/deploying project qgroundcontrol (kit: Desktop Qt 5.15.2 GCC 64bit) When executing step "Make"
This currently applies to Airmap on Linux, which is optional but enabled by default.
airmap을 비활성화 합니다.
$ echo -e "DEFINES += DISABLE_AIRMAP\r\n" | tee user_config.pri