2016-03-18 09:49:43 +00:00
|
|
|
contains(TEMPLATE, ".*app"):!build_pass: {
|
2013-10-07 20:42:11 +00:00
|
|
|
|
|
|
|
defineReplace(emitString) {
|
|
|
|
return("\"$$replace(1, \\\\, \\\\)\"")
|
|
|
|
}
|
|
|
|
|
2013-09-05 11:18:15 +00:00
|
|
|
FILE_CONTENT = "{"
|
|
|
|
FILE_CONTENT += " \"description\": \"This file is generated by qmake to be read by androiddeployqt and should not be modified by hand.\","
|
|
|
|
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"qt\": $$emitString($$[QT_INSTALL_PREFIX]),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
# Settings from mkspecs/environment
|
2014-07-29 13:13:57 +00:00
|
|
|
FILE_CONTENT += " \"sdk\": $$emitString($$ANDROID_SDK_ROOT),"
|
|
|
|
FILE_CONTENT += " \"sdkBuildToolsRevision\": $$emitString($$ANDROID_SDK_BUILD_TOOLS_REVISION),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
isEmpty(NDK_ROOT): NDK_ROOT = $$(ANDROID_NDK_ROOT)
|
|
|
|
isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"ndk\": $$emitString($$NDK_ROOT),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
|
|
|
|
isEmpty(NDK_TOOLCHAIN_PREFIX) {
|
|
|
|
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
|
2017-01-31 20:15:24 +00:00
|
|
|
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
|
2013-09-05 11:18:15 +00:00
|
|
|
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
|
2017-01-31 20:15:24 +00:00
|
|
|
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
|
|
|
|
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
|
2013-09-05 11:18:15 +00:00
|
|
|
else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
|
|
|
|
}
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX),"
|
2013-10-16 12:45:45 +00:00
|
|
|
FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION)
|
|
|
|
isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"toolchain-version\": $$emitString($$NDK_TOOLCHAIN_VERSION),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
NDK_HOST = $$(ANDROID_NDK_HOST)
|
|
|
|
isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"ndk-host\": $$emitString($$NDK_HOST),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
ANDROID_TARGET_ARCH = $$(ANDROID_TARGET_ARCH)
|
|
|
|
isEmpty(ANDROID_TARGET_ARCH): ANDROID_TARGET_ARCH = $$DEFAULT_ANDROID_TARGET_ARCH
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"target-architecture\": $$emitString($$ANDROID_TARGET_ARCH),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
2014-03-07 12:56:01 +00:00
|
|
|
# Explicitly set qt dependencies of application for deployment
|
2013-09-05 11:18:15 +00:00
|
|
|
!isEmpty(ANDROID_DEPLOYMENT_DEPENDENCIES): \
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"deployment-dependencies\": $$emitString($$join(ANDROID_DEPLOYMENT_DEPENDENCIES, ",")),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
2014-03-07 12:56:01 +00:00
|
|
|
# Explicitly set external dependencies of application for deployment
|
|
|
|
!isEmpty(ANDROID_EXTRA_PLUGINS): \
|
|
|
|
FILE_CONTENT += " \"android-extra-plugins\": $$emitString($$join(ANDROID_EXTRA_PLUGINS, ",")),"
|
|
|
|
|
2013-09-05 11:18:15 +00:00
|
|
|
# Android-specific settings of Project
|
|
|
|
!isEmpty(ANDROID_PACKAGE_SOURCE_DIR): \
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"android-package-source-directory\": $$emitString($$ANDROID_PACKAGE_SOURCE_DIR),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
|
|
|
!isEmpty(ANDROID_EXTRA_LIBS): \
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"android-extra-libs\": $$emitString($$join(ANDROID_EXTRA_LIBS, ",")),"
|
2013-09-05 11:18:15 +00:00
|
|
|
|
2014-07-22 08:01:01 +00:00
|
|
|
!isEmpty(QML_IMPORT_PATH): \
|
|
|
|
FILE_CONTENT += " \"qml-import-paths\": $$emitString($$join(QML_IMPORT_PATH, ",")),"
|
|
|
|
|
|
|
|
isEmpty(QML_ROOT_PATH): \
|
|
|
|
QML_ROOT_PATH = $$_PRO_FILE_PWD_
|
|
|
|
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
|
|
|
|
|
2013-10-07 20:42:11 +00:00
|
|
|
FILE_CONTENT += " \"application-binary\": $$emitString($$absolute_path($$DESTDIR, $$OUT_PWD)/$$TARGET)"
|
2013-09-05 11:18:15 +00:00
|
|
|
FILE_CONTENT += "}"
|
|
|
|
|
|
|
|
isEmpty(ANDROID_DEPLOYMENT_SETTINGS_FILE): ANDROID_DEPLOYMENT_SETTINGS_FILE = $$OUT_PWD/android-$$TARGET-deployment-settings.json
|
|
|
|
|
2016-07-14 14:50:02 +00:00
|
|
|
write_file($$ANDROID_DEPLOYMENT_SETTINGS_FILE, FILE_CONTENT)|error()
|
2013-09-05 11:18:15 +00:00
|
|
|
}
|
|
|
|
|