From 5b39c909baeb3e4c247a43b91a884d5990c99092 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 6 Feb 2015 01:24:23 +0100 Subject: Move Android toolchain module to ECM Introduces the new Android toolchain file for being able to easily compile our cmake projects in Android, with an emphasis on Qt projects. CHANGELOG: New Android toolchain support module. REVIEW: 121545 --- toolchain/Android.cmake | 183 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 toolchain/Android.cmake (limited to 'toolchain/Android.cmake') diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake new file mode 100644 index 00000000..8272ef9d --- /dev/null +++ b/toolchain/Android.cmake @@ -0,0 +1,183 @@ +#.rst: +# AndroidToolchain +# ------------------- +# +# Enable easy compilation of cmake projects on Android +# +# By using this android toolchain, the projects will be set up to compile the +# specified project targeting an Android platform, depending on its input. +# Furthermore, if desired, an APK can be directly generated by using the +# androiddeployqt tool. +# +# Note: Requires CMake 3.1 +# +# How to use it? +# -------------- +# First of all, to make use of this toolchain file it's required to specify the +# CMAKE_TOOLCHAIN_FILE variable pointing to AndroidToolchain.cmake. +# +# Then, there's many settings that we may want to specify under what circumstances +# the project will be built. This will be done through environment variables: +# - ANDROID_NDK: points to the NDK root path +# - ANDROID_SDK_ROOT: points to the SDK root path +# +# Also there's some cache variables we can pass as well to narrow down the +# preferred settings: +# - ANDROID_NDK: Points to the NDK root, defaults to the environment variable +# with the same name. +# - ANDROID_SDK_ROOT: Points to the Android SDK root, defaults to the environment +# variable with the same name. +# - ANDROID_ARCHITECTURE: Specifies the used architecture, "arm" by default. See +# arch-* directory. +# - ANDROID_TOOLCHAIN: Specifies the toolchain to be used. Defaults to +# "arm-linux-androideabi". See /toolchains/ directory. +# - ANDROID_ABI: Specifies the ABI to be used. Defaults to "armeabi-v7a". See +# /sources/cxx-stl/gnu-libstdc++/*/libs/ directories. +# - ANDROID_GCC_VERSION: Specifies the GCC version. Defaults to "4.9". +# - ANDROID_API_LEVEL: Specifies the API level to require. Defaults to "14". See +# http://developer.android.com/guide/topics/manifest/uses-sdk-element.html +# - ANDROID_SDK_BUILD_TOOLS_REVISION: Specifies the build tools version to be used. +# Defaults to "21.1.1". +# +# Once we have the application built, we will want to generate an APK that we +# can run on an Android device. To this end we've integrated androiddeployqt so +# this can be done easily. This won't work with non-qt projects. +# To make use of the APK generation, we'll define QTANDROID_EXPORTED_TARGET with +# the target we want to have exported. +# Additionally, we'll need to specify a ANDROID_APK_DIR with the base information +# to set the project up. For more information see: +# https://qt-project.org/doc/qt-5-snapshot/deployment-android.html +# +# Once set up, after building, make create-apk- will process this +# input and generate an apk that can be found inside the build directory: +# ${CMAKE_BINARY_DIR}/_build_apk/bin/QtApp-*.apk. +# +# ============================================================================= +# Copyright 2014 Aleix Pol i Gonzalez +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file COPYING-CMAKE-SCRIPTS for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of extra-cmake-modules, substitute the full +# License text for the above reference.) + +cmake_minimum_required(VERSION "3.1") + +#input +set(ANDROID_NDK "$ENV{ANDROID_NDK}" CACHE path "Android NDK path") +set(ANDROID_SDK_ROOT "$ENV{ANDROID_SDK_ROOT}" CACHE path "Android SDK path") +set(ANDROID_ARCHITECTURE "arm" CACHE string "Used Architecture, related to the ABI and TOOLCHAIN") +set(ANDROID_TOOLCHAIN "arm-linux-androideabi" CACHE string "Used SDK") +set(ANDROID_ABI "armeabi-v7a" CACHE string "Used ABI") +set(ANDROID_GCC_VERSION "4.9" CACHE string "Used GCC version" ) +set(ANDROID_API_LEVEL "14" CACHE string "Android API Level") +set(ANDROID_SDK_BUILD_TOOLS_REVISION "21.1.1" CACHE string "Android API Level") + +set(_HOST "${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}") +string(TOLOWER "${_HOST}" _HOST) + +get_filename_component(_CMAKE_ANDROID_DIR "${CMAKE_TOOLCHAIN_FILE}" PATH) + +cmake_policy(SET CMP0011 OLD) +cmake_policy(SET CMP0017 OLD) + +set(CMAKE_SYSROOT + "${ANDROID_NDK}/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCHITECTURE}") +if(NOT EXISTS ${CMAKE_SYSROOT}) + message(FATAL_ERROR "Couldn't find the Android NDK Root in ${CMAKE_SYSROOT}") +endif() + +#actual code +SET(CMAKE_SYSTEM_NAME Android) +SET(CMAKE_SYSTEM_VERSION 1) + +set(ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN}-${ANDROID_GCC_VERSION}/prebuilt/${_HOST}/bin") +set(ANDROID_LIBS_ROOT "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}") + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM "${ANDROID_TOOLCHAIN_ROOT}") +set(ANDROID_LIBRARIES_PATH + "${CMAKE_SYSROOT}/usr/lib") +set(CMAKE_SYSTEM_LIBRARY_PATH + ${ANDROID_LIBRARIES_PATH} + "${ANDROID_LIBS_ROOT}/libs/${ANDROID_ABI}/" +) +set(CMAKE_FIND_LIBRARY_SUFFIXES ".so") +set(CMAKE_FIND_LIBRARY_PREFIXES "lib") +find_library(GNUSTL_SHARED gnustl_shared) +if(NOT GNUSTL_SHARED) + message(FATAL_ERROR "you need gnustl_shared: ${CMAKE_SYSTEM_LIBRARY_PATH}") +endif() +include_directories(SYSTEM + "${CMAKE_SYSROOT}/usr/include" + "${ANDROID_LIBS_ROOT}/include/" + "${ANDROID_LIBS_ROOT}/libs/${ANDROID_ABI}/include" +) + +link_directories(${CMAKE_SYSTEM_LIBRARY_PATH}) + +set(CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-gcc") +set(CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-g++") + +SET(CMAKE_FIND_ROOT_PATH ${ANDROID_NDK}) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +set(CMAKE_EXE_LINKER_FLAGS "${GNUSTL_SHARED} -Wl,-rpath-link,${ANDROID_LIBRARIES_PATH} -llog -lz -lm -ldl -lc -lgcc" CACHE STRING "") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "") +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "") + +#we want executables to be shared libraries, hooks will invoke the exported cmake function +set(CMAKE_CXX_LINK_EXECUTABLE + " -o " +) + +######### generation + +set(CREATEAPK_TARGET_NAME "create-apk-${QTANDROID_EXPORTED_TARGET}") +if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) + if(NOT EXISTS "${ANDROID_APK_DIR}/AndroidManifest.xml") + message(FATAL_ERROR "Define an apk dir to initialize from using -DANDROID_APK_DIR=. The specified directory must contain the AndroidManifest.xml file.") + endif() + + function(EOFHook) + if(CMAKE_PARENT_LIST_FILE STREQUAL "") + generate_deployment_file() + endif() + endfunction() + + function(generate_deployment_file) + get_property(_DEPENDENCIES TARGET ${QTANDROID_EXPORTED_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES) + set(_DEPS_LIST) + foreach(_DEP IN LISTS _DEPENDENCIES) + if(NOT _DEP MATCHES "Qt5::.*") + get_property(_DEP_LOCATION TARGET ${_DEP} PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}") + list(APPEND _DEPS_LIST ${_DEP_LOCATION}) + endif() + endforeach() + string(REPLACE ";" "," _DEPS "${_DEPS_LIST}") + configure_file("${_CMAKE_ANDROID_DIR}/deployment-file.json.in" "${QTANDROID_EXPORTED_TARGET}-deployment.json") + endfunction() + +# Create the target that will eventually generate the apk + get_filename_component(QTDIR "${Qt5Core_DIR}/../../../" ABSOLUTE) + find_program(ANDROID_DEPLOY_QT androiddeployqt HINTS "${QTDIR}/bin") + set(EXPORT_DIR "${CMAKE_BINARY_DIR}/${QTANDROID_EXPORTED_TARGET}_build_apk/") + set(EXECUTABLE_DESTINATION_PATH "${EXPORT_DIR}/libs/${ANDROID_ABI}/lib${QTANDROID_EXPORTED_TARGET}.so") + + add_custom_target(${CREATEAPK_TARGET_NAME} + COMMAND cmake -E echo "Generating $ with ${ANDROID_DEPLOY_QT}" + COMMAND cmake -E copy_directory "${ANDROID_APK_DIR}" "${EXPORT_DIR}" + COMMAND cmake -E copy "$" "${EXECUTABLE_DESTINATION_PATH}" + COMMAND ${ANDROID_DEPLOY_QT} --input "${QTANDROID_EXPORTED_TARGET}-deployment.json" --output "${EXPORT_DIR}" --deployment bundled "\\$(ARGS)" + ) + + #we want to call the function after the project has been set up + variable_watch(CMAKE_PARENT_LIST_FILE EOFHook) +else() + message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET=") +endif() -- cgit v1.2.1 From 98a1ac4bf153581865662bd55fd139844d2de5cd Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 6 Feb 2015 12:31:05 +0000 Subject: Add Android toolchain module to the documentation. --- toolchain/Android.cmake | 114 +++++++++++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 46 deletions(-) (limited to 'toolchain/Android.cmake') diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 8272ef9d..55d2ca81 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -1,57 +1,79 @@ #.rst: # AndroidToolchain -# ------------------- +# ---------------- # -# Enable easy compilation of cmake projects on Android +# Enable easy compilation of cmake projects on Android. # # By using this android toolchain, the projects will be set up to compile the # specified project targeting an Android platform, depending on its input. # Furthermore, if desired, an APK can be directly generated by using the -# androiddeployqt tool. -# -# Note: Requires CMake 3.1 -# -# How to use it? -# -------------- -# First of all, to make use of this toolchain file it's required to specify the -# CMAKE_TOOLCHAIN_FILE variable pointing to AndroidToolchain.cmake. -# -# Then, there's many settings that we may want to specify under what circumstances -# the project will be built. This will be done through environment variables: -# - ANDROID_NDK: points to the NDK root path -# - ANDROID_SDK_ROOT: points to the SDK root path -# -# Also there's some cache variables we can pass as well to narrow down the -# preferred settings: -# - ANDROID_NDK: Points to the NDK root, defaults to the environment variable -# with the same name. -# - ANDROID_SDK_ROOT: Points to the Android SDK root, defaults to the environment -# variable with the same name. -# - ANDROID_ARCHITECTURE: Specifies the used architecture, "arm" by default. See -# arch-* directory. -# - ANDROID_TOOLCHAIN: Specifies the toolchain to be used. Defaults to -# "arm-linux-androideabi". See /toolchains/ directory. -# - ANDROID_ABI: Specifies the ABI to be used. Defaults to "armeabi-v7a". See -# /sources/cxx-stl/gnu-libstdc++/*/libs/ directories. -# - ANDROID_GCC_VERSION: Specifies the GCC version. Defaults to "4.9". -# - ANDROID_API_LEVEL: Specifies the API level to require. Defaults to "14". See -# http://developer.android.com/guide/topics/manifest/uses-sdk-element.html -# - ANDROID_SDK_BUILD_TOOLS_REVISION: Specifies the build tools version to be used. -# Defaults to "21.1.1". -# -# Once we have the application built, we will want to generate an APK that we -# can run on an Android device. To this end we've integrated androiddeployqt so -# this can be done easily. This won't work with non-qt projects. -# To make use of the APK generation, we'll define QTANDROID_EXPORTED_TARGET with -# the target we want to have exported. -# Additionally, we'll need to specify a ANDROID_APK_DIR with the base information -# to set the project up. For more information see: -# https://qt-project.org/doc/qt-5-snapshot/deployment-android.html -# -# Once set up, after building, make create-apk- will process this -# input and generate an apk that can be found inside the build directory: -# ${CMAKE_BINARY_DIR}/_build_apk/bin/QtApp-*.apk. +# `androiddeployqt `_ tool. # +# .. note:: +# +# This module requires CMake 3.1. +# +# Since 1.7.0. +# +# Usage +# ===== +# +# To use this file, you need to set the ``CMAKE_TOOLCHAIN_FILE`` to point to +# ``AndroidToolchain.cmake`` on the command line:: +# +# cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake +# +# You will also need to provide the locations of the Android NDK and SDK. This +# can be done on the commandline or with environment variables; in either case +# the variable names are: +# +# ``ANDROID_NDK`` +# The NSK root path. +# ``ANDROID_SDK_ROOT`` +# The SSK root path. +# +# Additional options are specified as cache variables (eg: on the command line): +# +# ``ANDROID_ARCHITECTURE`` +# The architecture to compile for. Default: ``arm``. +# ``ANDROID_TOOLCHAIN`` +# The toolchain to use. See the ``toolchains`` directory of the NDK. +# Default: ``arm-linux-androideabi``. +# ``ANDROID_ABI`` +# The ABI to use. See the ``sources/cxx-stl/gnu-libstdc++/*/libs`` +# directories in the NDK. Default: ``armeabi-v7a``. +# ``ANDROID_GCC_VERSION`` +# The GCC version to use. Default: ``4.9``. +# ``ANDROID_API_LEVEL`` +# The `API level +# `_ +# to require. Default: ``14``. +# ``ANDROID_SDK_BUILD_TOOLS_REVISION`` +# The build tools version to use. Default: ``21.1.1``. +# +# Deploying Qt Applications +# ========================= +# +# After building the application, you will need to generate an APK that can be +# deployed to an Android device. This module integrates androiddeployqt support +# to help with this for Qt-based projects. To enable this, set the +# ``QTANDROID_EXPORTED_TARGET`` variable to the target you wish to export as an +# APK, as well as ``ANDROID_APK_DIR`` to a directory containing some basic +# information. This will create a ``create-apk-`` target that will +# generate the APK file. See the `Qt on Android deployment documentation +# `_ for more information. +# +# For example, you could do:: +# +# cmake \ +# -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/AndroidToolchain.cmake \ +# -DQTANDROID_EXPORTED_TARGET=myapp \ +# -DANDROID_APK_DIR=myapp-apk +# make +# make create-apk-myapp +# +# The APK would then be found in ``myapp_build_apk/bin`` in the build directory. + # ============================================================================= # Copyright 2014 Aleix Pol i Gonzalez # -- cgit v1.2.1 From bd7aa7a91ab75639ddc3a274718da55e6cd2ae81 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 9 Feb 2015 12:44:29 +0100 Subject: Add comment to Android toolchain file. --- toolchain/Android.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'toolchain/Android.cmake') diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 55d2ca81..0144f379 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -161,6 +161,9 @@ set(CMAKE_CXX_LINK_EXECUTABLE ######### generation set(CREATEAPK_TARGET_NAME "create-apk-${QTANDROID_EXPORTED_TARGET}") +# Need to ensure we only get in here once, as this file is included twice: +# from CMakeDetermineSystem.cmake and from CMakeSystem.cmake generated within the +# build directory. if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) if(NOT EXISTS "${ANDROID_APK_DIR}/AndroidManifest.xml") message(FATAL_ERROR "Define an apk dir to initialize from using -DANDROID_APK_DIR=. The specified directory must contain the AndroidManifest.xml file.") @@ -184,6 +187,8 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) string(REPLACE ";" "," _DEPS "${_DEPS_LIST}") configure_file("${_CMAKE_ANDROID_DIR}/deployment-file.json.in" "${QTANDROID_EXPORTED_TARGET}-deployment.json") endfunction() + #we want to call the function after the project has been set up + variable_watch(CMAKE_PARENT_LIST_FILE EOFHook) # Create the target that will eventually generate the apk get_filename_component(QTDIR "${Qt5Core_DIR}/../../../" ABSOLUTE) @@ -197,9 +202,6 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) COMMAND cmake -E copy "$" "${EXECUTABLE_DESTINATION_PATH}" COMMAND ${ANDROID_DEPLOY_QT} --input "${QTANDROID_EXPORTED_TARGET}-deployment.json" --output "${EXPORT_DIR}" --deployment bundled "\\$(ARGS)" ) - - #we want to call the function after the project has been set up - variable_watch(CMAKE_PARENT_LIST_FILE EOFHook) else() message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET=") endif() -- cgit v1.2.1 From faedc8d01697ab1d573d5740f24e7279f4dba14f Mon Sep 17 00:00:00 2001 From: Andreas Cord-Landwehr Date: Sat, 12 Sep 2015 10:15:18 +0200 Subject: Add definition ANDROID as needed in qsystemdetection.h. QtCore/qsystemdetection.h sets the define Q_OS_ANDROID based on having ANDROID defined. Hence, adding the ANDROID define allows applications to use the Q_OS_ANDROID for ifdef'ing. REVIEW: 125183 --- toolchain/Android.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'toolchain/Android.cmake') diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 0144f379..bfc166a8 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -139,6 +139,9 @@ include_directories(SYSTEM "${ANDROID_LIBS_ROOT}/libs/${ANDROID_ABI}/include" ) +# needed for Qt to define Q_OS_ANDROID +add_definitions(-DANDROID) + link_directories(${CMAKE_SYSTEM_LIBRARY_PATH}) set(CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN}-gcc") -- cgit v1.2.1 From 3915bacd6055087bf71ccabc5c9ddf15743f4e9a Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Sun, 13 Sep 2015 01:57:58 +0200 Subject: Use Qt5 to specify what's Qt5 installation prefix --- toolchain/Android.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolchain/Android.cmake') diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index bfc166a8..9b104747 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -172,6 +172,8 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) message(FATAL_ERROR "Define an apk dir to initialize from using -DANDROID_APK_DIR=. The specified directory must contain the AndroidManifest.xml file.") endif() + find_package(Qt5Core REQUIRED) + function(EOFHook) if(CMAKE_PARENT_LIST_FILE STREQUAL "") generate_deployment_file() -- cgit v1.2.1 From 3b20ef911eb83b7bd37315ace682e0e6bc6195d9 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 1 Oct 2015 01:25:03 +0200 Subject: Remove workaround to delay execution on Android * Remove get_property calls on targets, this way we don't need to be called right before configuration time. * Removes EOFHook Instead we process it at generation time using the link.txt file (which is probably another hack) REVIEW: 125084 --- toolchain/Android.cmake | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'toolchain/Android.cmake') diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 9b104747..a60771bc 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -174,38 +174,16 @@ if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET ${CREATEAPK_TARGET_NAME}) find_package(Qt5Core REQUIRED) - function(EOFHook) - if(CMAKE_PARENT_LIST_FILE STREQUAL "") - generate_deployment_file() - endif() - endfunction() - - function(generate_deployment_file) - get_property(_DEPENDENCIES TARGET ${QTANDROID_EXPORTED_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES) - set(_DEPS_LIST) - foreach(_DEP IN LISTS _DEPENDENCIES) - if(NOT _DEP MATCHES "Qt5::.*") - get_property(_DEP_LOCATION TARGET ${_DEP} PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}") - list(APPEND _DEPS_LIST ${_DEP_LOCATION}) - endif() - endforeach() - string(REPLACE ";" "," _DEPS "${_DEPS_LIST}") - configure_file("${_CMAKE_ANDROID_DIR}/deployment-file.json.in" "${QTANDROID_EXPORTED_TARGET}-deployment.json") - endfunction() - #we want to call the function after the project has been set up - variable_watch(CMAKE_PARENT_LIST_FILE EOFHook) - -# Create the target that will eventually generate the apk - get_filename_component(QTDIR "${Qt5Core_DIR}/../../../" ABSOLUTE) - find_program(ANDROID_DEPLOY_QT androiddeployqt HINTS "${QTDIR}/bin") set(EXPORT_DIR "${CMAKE_BINARY_DIR}/${QTANDROID_EXPORTED_TARGET}_build_apk/") set(EXECUTABLE_DESTINATION_PATH "${EXPORT_DIR}/libs/${ANDROID_ABI}/lib${QTANDROID_EXPORTED_TARGET}.so") + configure_file("${_CMAKE_ANDROID_DIR}/deployment-file.json.in" "${QTANDROID_EXPORTED_TARGET}-deployment.json.in") add_custom_target(${CREATEAPK_TARGET_NAME} - COMMAND cmake -E echo "Generating $ with ${ANDROID_DEPLOY_QT}" + COMMAND cmake -E echo "Generating $ with $/androiddeployqt" COMMAND cmake -E copy_directory "${ANDROID_APK_DIR}" "${EXPORT_DIR}" COMMAND cmake -E copy "$" "${EXECUTABLE_DESTINATION_PATH}" - COMMAND ${ANDROID_DEPLOY_QT} --input "${QTANDROID_EXPORTED_TARGET}-deployment.json" --output "${EXPORT_DIR}" --deployment bundled "\\$(ARGS)" + COMMAND cmake -DINPUT_FILE="${QTANDROID_EXPORTED_TARGET}-deployment.json.in" -DOUTPUT_FILE="${QTANDROID_EXPORTED_TARGET}-deployment.json" "-DTARGET_DIR=$" "-DTARGET_NAME=${QTANDROID_EXPORTED_TARGET}" -P ${_CMAKE_ANDROID_DIR}/specifydependencies.cmake + COMMAND $/androiddeployqt --input "${QTANDROID_EXPORTED_TARGET}-deployment.json" --output "${EXPORT_DIR}" --deployment bundled "\\$(ARGS)" ) else() message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET=") -- cgit v1.2.1