aboutsummaryrefslogtreecommitdiff
path: root/find-modules/FindGradle.cmake
diff options
context:
space:
mode:
authorVolker Krause <vkrause@kde.org>2020-10-24 17:04:22 +0200
committerVolker Krause <vkrause@kde.org>2020-11-01 10:30:10 +0000
commit2135cbdfa6da743f32f3d03b0661313caecc7b16 (patch)
treea7a71a5cb2ccb38e3f0be9063088f499266d2d42 /find-modules/FindGradle.cmake
parentf1bf6bd813bebb2d95cdfb404bc5406be87814ae (diff)
downloadextra-cmake-modules-2135cbdfa6da743f32f3d03b0661313caecc7b16.tar.gz
extra-cmake-modules-2135cbdfa6da743f32f3d03b0661313caecc7b16.tar.bz2
Make androiddeployqt find libraries and QML plugins without installationv5.76.0-rc1v5.76.0
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).
Diffstat (limited to 'find-modules/FindGradle.cmake')
-rw-r--r--find-modules/FindGradle.cmake2
1 files changed, 2 insertions, 0 deletions
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}