Qt6 Android how to add openssl if target is a library.
-
I'm building an android native app with Android Studio and a Qt6 library (no gui). With cmake I have already added Qt6::Core Qt6::Network, but I have many problems to include android_openssl to have the https support.
Following the docs is not enough because I'm getting always
No functional TLS backend was foundSo I decided to create a simple cmake project with QtCreator and following the hints inside android_openssl repository and I get QSslSocket working. The hints are:
- using qt_add_executable(...) with MANUAL_FINALIZATION flag
- then include android_openssl/CMakeLists.txt updated for Qt6
- at the end call qt_finalize_target(...)
This was enough to make my simple test works.
Get back to my initial project, I'm building a library for Android so I have translated the qt_add_executable(...) in qt_add_library(...) always with MANUAL_FINALIZATION flag on.
But now, I just discover that qt_finalize_target is an empty macro is the target is a library, and my whole library is not builded. Oblivisiouly if I switch qt_add_library with cmake add_library the library is builded but without openssl.Anyone can help?