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)
아키텍처별 라이브러리를 멀티에이비 프로젝트에 추가할 때는 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})
over:
set_target_properties(MyApp PROPERTIES QT_ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_BINARY_DIR}/libA_${CMAKE_ANDROID_ARCH_ABI}.so)
© 2025 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.