Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
None
-
Qt Creator 4.10.0-beta2
-
None
-
amd64, ubuntu, wayland, sway
Description
Hi Guys, just realized that if ANDROID_EXTRA_LIBS is filled as LIST in the cmake project - it can't be processed by androiddeployqt, because lib paths of "android-extra-libs" in android_deployment_settings.json will be separated by ";" instead of ",".
For example:
- lib/lib1.cmake:
set(CUSTOM_ANDROID_EXTRA_LIBS ${CUSTOM_ANDROID_EXTRA_LIBS} lib1.so CACHE INTERNAL "")
- lib/lib2.cmake:
set(CUSTOM_ANDROID_EXTRA_LIBS ${CUSTOM_ANDROID_EXTRA_LIBS} lib2.so CACHE INTERNAL "")
- CMakeLists.txt:
... include(lib/lib1.cmake) include(lib/lib2.cmake) ...
Result in android_deployment_settings.json:
{ "android-extra-libs": "lib1.so;lib2.so", ...
Most probably it's expecting a string, but in the qtquickapplication/CMakeLists.txt wizard template:
set(ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so CACHE INTERNAL "")
That gives us:
"android-extra-libs": "/home/user/Projects/test/path/to/libcrypto.so;/home/user/Projects/test/path/to/libssl.so"
I'm using the next workaround for now, but it looks not so good:
list(APPEND CUSTOM_ANDROID_EXTRA_LIBS lib1.so) list(APPEND CUSTOM_ANDROID_EXTRA_LIBS lib2.so) list(REMOVE_DUPLICATES CUSTOM_ANDROID_EXTRA_LIBS) string(REPLACE ";" "," CUSTOM_ANDROID_EXTRA_LIBS_STRING "${CUSTOM_ANDROID_EXTRA_LIBS}") set(ANDROID_EXTRA_LIBS "${CUSTOM_ANDROID_EXTRA_LIBS_STRING}" CACHE INTERNAL "")