QT_ANDROID_EXTRA_LIBS
Bibliotecas adicionales para desplegar con el objetivo.
Esta propiedad se introdujo en Qt 6.0.
Nota: Esta propiedad sólo se utiliza si el objetivo es la plataforma Android.
Una lista de librerías externas que se copiarán en la carpeta libs de tu aplicación y se cargarán al iniciarse. Esto se puede utilizar, por ejemplo, para habilitar OpenSSL en su aplicación. Para más información, consulta Añadir soporte OpenSSL para Android.
Al añadir librerías extra desde el árbol de construcción de tu proyecto, también es necesario añadir relaciones de dependencia entre la librería y el destino de la aplicación. El uso de la siguiente estructura de proyecto puede causar un problema, al desplegar un 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)Esto lleva a la incertidumbre de si la biblioteca MyService estará disponible antes del despliegue de MyApp o no. La solución más fácil es añadir la biblioteca MyService a las dependencias de MyApp:
add_dependencies(MyApp MyService)
Cuando agregue bibliotecas por arquitectura a un proyecto multi-abi, liste todas sus rutas explícitamente, en lugar de depender de variables como CMAKE_ANDROID_ARCH_ABI para calcular dinámicamente las rutas.
Es preferible:
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})sobre:
set_target_properties(MyApp PROPERTIES
QT_ANDROID_EXTRA_LIBS
${CMAKE_CURRENT_BINARY_DIR}/libA_${CMAKE_ANDROID_ARCH_ABI}.so)Véase también qt_android_generate_deployment_settings().
© 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.