From 2135cbdfa6da743f32f3d03b0661313caecc7b16 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sat, 24 Oct 2020 17:04:22 +0200 Subject: Make androiddeployqt find libraries and QML plugins without installation This matters for libraries in the same repository as the application that also have an AAR that needs to be integrated, as well as QML plugins. For this to work we need to consider the build directory as a search prefix, and produce the exact directory layout there that androiddeployqt expects. For libraries this is then almost transparent for the application build system, the only thing that needs to be taken care of manually is putting the corresponding -android-dependencies.xml file into the right place in the build dir as well. A macro wrapping that might be an option to centralize that logic here as well in the future. For QML plugins this is transparent if you have them set up to work without installation already anyway, otherwise that setup has to be done for this to work. Example: https://invent.kde.org/pim/itinerary/-/merge_requests/28 https://invent.kde.org/frameworks/knotifications/-/merge_requests/12 would presumably also need this (not tested yet). --- find-modules/FindGradle.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'find-modules/FindGradle.cmake') diff --git a/find-modules/FindGradle.cmake b/find-modules/FindGradle.cmake index 08221d43..414ea661 100644 --- a/find-modules/FindGradle.cmake +++ b/find-modules/FindGradle.cmake @@ -71,6 +71,8 @@ function(gradle_add_aar target) add_custom_command( OUTPUT ${_build_root}/build/outputs/aar/${ARG_NAME}${_aar_suffix}.aar COMMAND ${Gradle_EXECUTABLE} ${_aar_gradleCmd} + # this allows make create-apk to work without installations for apps with AAR libs in the same repository + COMMAND ${CMAKE_COMMAND} -E copy ${_build_root}/build/outputs/aar/${ARG_NAME}${_aar_suffix}.aar ${CMAKE_BINARY_DIR}/jar/${ARG_NAME}.aar DEPENDS ${Gradle_EXECUTABLE} ${_src_files} DEPENDS gradle WORKING_DIRECTORY ${_build_root} -- cgit v1.2.1