aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--find-modules/FindGradle.cmake2
-rw-r--r--kde-modules/KDECMakeSettings.cmake7
-rw-r--r--toolchain/ECMAndroidDeployQt.cmake12
3 files changed, 15 insertions, 6 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}
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake
index 126b0a04..03d10d16 100644
--- a/kde-modules/KDECMakeSettings.cmake
+++ b/kde-modules/KDECMakeSettings.cmake
@@ -254,6 +254,13 @@ if(NOT KDE_SKIP_BUILD_SETTINGS)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()
+ # For Android we need to put shared libraries into "lib" for androiddeployqt to work without prior installation.
+ # That fact that this conflicts with the above isn't really an issue, as we can't run things while cross-compiling
+ # for Android anyway.
+ if (ANDROID)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+ endif()
+
if (APPLE)
# Disable detection of X11 and related package on OS X because when using
# brew or macports, X11 can be installed and thus is detected.
diff --git a/toolchain/ECMAndroidDeployQt.cmake b/toolchain/ECMAndroidDeployQt.cmake
index 06943390..74f4c550 100644
--- a/toolchain/ECMAndroidDeployQt.cmake
+++ b/toolchain/ECMAndroidDeployQt.cmake
@@ -9,6 +9,10 @@ function(ecm_androiddeployqt QTANDROID_EXPORTED_TARGET ECM_ADDITIONAL_FIND_ROOT_
set(EXECUTABLE_DESTINATION_PATH "${EXPORT_DIR}/libs/${CMAKE_ANDROID_ARCH_ABI}/lib${QTANDROID_EXPORTED_TARGET}_${CMAKE_ANDROID_ARCH_ABI}.so")
endif()
set(QML_IMPORT_PATHS "")
+ # add build directory to the search path as well, so this works without installation
+ if (EXISTS ${CMAKE_BINARY_DIR}/lib)
+ set(QML_IMPORT_PATHS ${CMAKE_BINARY_DIR}/lib)
+ endif()
foreach(prefix ${ECM_ADDITIONAL_FIND_ROOT_PATH})
# qmlimportscanner chokes on symlinks, so we need to resolve those first
get_filename_component(qml_path "${prefix}/lib/qml" REALPATH)
@@ -24,13 +28,9 @@ function(ecm_androiddeployqt QTANDROID_EXPORTED_TARGET ECM_ADDITIONAL_FIND_ROOT_
set(DEFINE_QML_IMPORT_PATHS "\"qml-import-paths\": \"${QML_IMPORT_PATHS}\",")
endif()
- set(EXTRA_PREFIX_DIRS "")
+ set(EXTRA_PREFIX_DIRS "\"${CMAKE_BINARY_DIR}\"")
foreach(prefix ${ECM_ADDITIONAL_FIND_ROOT_PATH})
- if (EXTRA_PREFIX_DIRS)
- set(EXTRA_PREFIX_DIRS "${EXTRA_PREFIX_DIRS}, \"${prefix}\"")
- else()
- set(EXTRA_PREFIX_DIRS "\"${prefix}\"")
- endif()
+ set(EXTRA_PREFIX_DIRS "${EXTRA_PREFIX_DIRS}, \"${prefix}\"")
endforeach()
if (Qt5Core_VERSION VERSION_LESS 5.14.0)