HarmonyOS용 Qt - 소스 코드로부터 빌드하기
참고: HarmonyOS용Qt는 기술 미리보기 단계에 있으며 향후 릴리스에서 변경될 수 있습니다.
이 페이지에서는 소스 코드를 사용하여 Qt for HarmonyOS를 구성하고 빌드하는 방법을 설명합니다.
필수 조건
계속 진행하기 전에, ‘Qt for HarmonyOS 필수 조건’에 명시된 모든 요구 사항을 충족하는지 확인하십시오.
HarmonyOS용 Qt 빌드는 크로스 컴파일 방식입니다. 즉, 호스트 Qt 빌드의 빌드 도구를 사용하여 HarmonyOS 대상용 Qt 라이브러리를 빌드합니다. 따라서 먼저 호스트 플랫폼용 Qt 빌드가 필요합니다. Qt 크로스 컴파일에 대한 일반적인 배경 정보는 ‘Qt for Device Creation’ 및 ‘Qt 크로스 컴파일’을 참조하십시오.
구성 및 빌드
OpenHarmony SDK와 호스트 Qt 빌드를 빌드 대상으로 지정하여 Qt for HarmonyOS를 구성하십시오:
configure -ohos-sdk <SDK_ROOT> -qt-host-path <HOST_QT_PATH> -ohos-arch arm64-v8a
cmake --build .관련 configure 옵션은 다음과 같습니다:
-ohos-sdkOpenHarmony SDK의 루트 경로를 설정합니다. 생략할 경우, `configure`는 `OHOS_SDK_ROOT` 환경 변수의 값을 사용합니다.-ohos-arch대상 아키텍처를 설정합니다. 실제 기기의 경우arm64-v8a를, 에뮬레이터의 경우x86_64를 사용하십시오. 생략할 경우,configure는 SDK를 기준으로 아키텍처를 선택합니다.-qt-host-path크로스 컴파일에 사용되는 Qt 호스트 빌드의 경로를 지정합니다.
설치
빌드가 완료된 후, HarmonyOS용 Qt를 설치합니다:
cmake --install .기본적으로 Qt는 /usr/local/Qt-<version> 에 설치됩니다. 다른 위치에 설치하려면 configure 에 -prefix 옵션을 전달하십시오. 이렇게 설치된 Qt for HarmonyOS는 ‘HarmonyOS용 Qt 애플리케이션 빌드 및 배포’에 설명된 대로 애플리케이션을 빌드하고 배포하는 데 사용됩니다.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.