aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-03-16 03:31:12 +0100
committerAleix Pol <aleixpol@kde.org>2017-03-16 15:11:55 +0100
commitc5d92deff24578f8258a724ca8a143c2d5f390a1 (patch)
tree394bf9d7d9701e2b673a2b81682712ed5b8ed587
parent7dc466a729c9972b941978db873e11540543303f (diff)
downloadextra-cmake-modules-c5d92deff24578f8258a724ca8a143c2d5f390a1.tar.gz
extra-cmake-modules-c5d92deff24578f8258a724ca8a143c2d5f390a1.tar.bz2
Specify qml-root-path as the share directory in the prefix
Summary: This way androiddeployqt will scan the imports. Otherwise it wouldn't pull qtquickcontrols2 for me Reviewers: #build_system, #frameworks, mart Reviewed By: mart Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5067
-rw-r--r--toolchain/Android.cmake5
-rw-r--r--toolchain/deployment-file.json.in1
2 files changed, 6 insertions, 0 deletions
diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake
index 9fed3610..9600e655 100644
--- a/toolchain/Android.cmake
+++ b/toolchain/Android.cmake
@@ -216,6 +216,7 @@ set(CMAKE_CXX_LINK_EXECUTABLE
# needed for Qt to define Q_OS_ANDROID
add_definitions(-DANDROID)
+set(ECM_DIR "${CMAKE_CURRENT_LIST_DIR}/.." CACHE STRING "")
######### generation
@@ -242,6 +243,10 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME})
COMMAND cmake -DINPUT_FILE="${QTANDROID_EXPORTED_TARGET}-deployment.json.in" -DOUTPUT_FILE="${QTANDROID_EXPORTED_TARGET}-deployment.json" "-DTARGET_DIR=$<TARGET_FILE_DIR:${QTANDROID_EXPORTED_TARGET}>" "-DTARGET_NAME=${QTANDROID_EXPORTED_TARGET}" "-DEXPORT_DIR=${CMAKE_INSTALL_PREFIX}" -P ${_CMAKE_ANDROID_DIR}/specifydependencies.cmake
COMMAND $<TARGET_FILE_DIR:Qt5::qmake>/androiddeployqt --input "${QTANDROID_EXPORTED_TARGET}-deployment.json" --output "${EXPORT_DIR}" --deployment bundled "\\$(ARGS)"
)
+
+ add_custom_target(install-apk-${QTANDROID_EXPORTED_TARGET}
+ COMMAND adb install -r "${EXPORT_DIR}/bin/QtApp-debug.apk"
+ )
else()
message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET=<targetname>")
endif()
diff --git a/toolchain/deployment-file.json.in b/toolchain/deployment-file.json.in
index e691e431..b7d28f51 100644
--- a/toolchain/deployment-file.json.in
+++ b/toolchain/deployment-file.json.in
@@ -8,6 +8,7 @@
"ndk-host": "@_HOST@",
"target-architecture": "@ANDROID_ABI@",
"application-binary": "@EXECUTABLE_DESTINATION_PATH@",
+ "qml-root-path": "@CMAKE_INSTALL_PREFIX@/share",
##EXTRALIBS##
##EXTRAPLUGINS##
"android-package-source-directory": "@ANDROID_APK_DIR@",