QT_ANDROID_EXTRA_LIBS
대상과 함께 배포할 추가 라이브러리.
이 속성은 Qt 6.0에서 도입되었습니다.
참고: 이 속성은 Android 플랫폼을 대상으로 하는 경우에만 사용됩니다.
애플리케이션의 ` libs ` 폴더로 복사되어 시작 시 로드될 외부 라이브러리 목록입니다. 예를 들어, 애플리케이션에서 OpenSSL을 활성화하는 데 사용할 수 있습니다. 자세한 내용은 ‘Android용 OpenSSL 지원 추가’를 참조하십시오.
프로젝트의 빌드 트리에서 추가 라이브러리를 추가할 때는 라이브러리와 애플리케이션 대상 간의 종속성 관계를 설정해야 합니다. 다음 프로젝트 구조를 사용할 경우 APK 배포 시 문제가 발생할 수 있습니다:
qt_add_executable(MyApp main.cpp)
set_target_properties(MyApp PROPERTIES
QT_ANDROID_EXTRA_LIBS
${CMAKE_CURRENT_BINARY_DIR}/libMyService_${ANDROID_ABI}.so
)
# MyService library doesn't have any relations with MyApp
qt_add_library(MyService service.cpp)이 경우 MyApp이 배포되기 전에 MyService 라이브러리를 사용할 수 있을지 여부가 불확실해집니다. 가장 쉬운 해결책은 MyService 라이브러리를 MyApp의 종속성에 추가하는 것입니다:
add_dependencies(MyApp MyService)다중 ABI 프로젝트에 아키텍처별 라이브러리를 추가할 때는, ` CMAKE_ANDROID_ARCH_ABI `와 같은 변수에 의존하여 경로를 동적으로 계산하는 대신, 모든 경로를 명시적으로 나열해야 합니다.
권장 방법:
set(libs
${CMAKE_CURRENT_BINARY_DIR}/libA_x86so
${CMAKE_CURRENT_BINARY_DIR}/libA_x86_64.so
${CMAKE_CURRENT_BINARY_DIR}/libA_arm64-v8a.so
${CMAKE_CURRENT_BINARY_DIR}/libA_armeabi-v7a.so
)
set_target_properties(MyApp PROPERTIES QT_ANDROID_EXTRA_LIBS ${libs})
# When targeting precompiled libs
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC libA_${ANDROID_ABI})다음보다는:
set_target_properties(MyApp PROPERTIES
QT_ANDROID_EXTRA_LIBS
${CMAKE_CURRENT_BINARY_DIR}/libA_${CMAKE_ANDROID_ARCH_ABI}.so)© 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.