QT_ANDROID_EXTRA_LIBS
Bibliotecas adicionales que se deben implementar con el destino.
Esta propiedad se introdujo en Qt 6.0.
Nota: Esta propiedad solo se utiliza si el destino es la plataforma Android.
Una lista de bibliotecas externas que se copiarán en la carpeta « libs » de tu aplicación y se cargarán al iniciarla. Esto se puede utilizar, por ejemplo, para habilitar OpenSSL en tu aplicación. Para obtener más información, consulta «Añadir compatibilidad con OpenSSL para Android».
Al añadir bibliotecas adicionales desde el árbol de compilación de tu proyecto, también es necesario añadir relaciones de dependencia entre la biblioteca y el destino de la aplicación. El uso de la siguiente estructura de proyecto puede provocar un problema al implementar 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 genera incertidumbre sobre si la biblioteca «MyService» estará disponible antes de la implementación de «MyApp» o no. La solución más sencilla es añadir la biblioteca «MyService» a las dependencias de «MyApp»:
add_dependencies(MyApp MyService)Al añadir bibliotecas específicas de cada arquitectura a un proyecto multi-abi, enumera todas sus rutas de forma explícita, en lugar de recurrir a variables como CMAKE_ANDROID_ARCH_ABI para calcular las rutas de forma dinámica.
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})en lugar de:
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.