QGroundControl(QGC) 개발자 가이드

- for masOS (3/9)

by 연화유심

Part 3. Source Code & Build + Navigating the Source Code (소스코드 빌드 및 탐색)

이 파트에서는 macOS 환경에서 QGroundControl(QGC)의 소스코드를 내려받고 빌드하는 방법을 설명한 후, 코드 구조와 주요 클래스를 탐색하는 방법을 다룹니다. 공식 Developer Guide의 'Getting Started with Source & Builds' 내용을 반영했습니다.


1) 소스코드 클론

```bash
git clone --recursive https://github.com/mavlink/qgroundcontrol.git
cd qgroundcontrol
git submodule update --init --recursive
```

2) Qt Creator 빌드

Qt 5.15.x 설치 필요 (`brew install qt@5`)

Qt Creator에서 `qgroundcontrol.pro` 열기 → Desktop Qt 5.15 clang kit 선택 → Build & Run

part 3 그림.jpg Image source: QGroundControl Documentation (CC BY 4.0, https://creativecommons.org/licenses/by/4.0/)
part 3 macOS 그림2.jpg

3) CMake + Xcode 빌드

```bash
mkdir build && cd build
cmake .. -G Xcode -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
open QGroundControl.xcodeproj
```


4) Docker 빌드

```bash
docker build -t qgc-dev .
docker run -it --rm qgc-dev
```


5) 코드 디렉토리 구조

src/ : QGC 핵심 로직

qml/ : UI 코드

libs/ : 외부 라이브러리

resources/ : 아이콘, 이미지, 번역 파일

test/ : 테스트 코드

cmake/ : 빌드 스크립트


6) 주요 클래스

QGCApplication, MainWindow, Vehicle, MAVLinkProtocol, MissionManager, GeoFenceManager, RallyPointManager

작가의 이전글QGroundControl(QGC) 개발자 가이드