2021-09-09 11:07:26 +00:00
|
|
|
contains(TEMPLATE, ".*app"):!build_pass {
|
2013-10-07 20:42:11 +00:00
|
|
|
|
|
|
|
defineReplace(emitString) {
|
2020-10-01 09:11:35 +00:00
|
|
|
return("\"$$clean_path($$1)\"")
|
2013-10-07 20:42:11 +00:00
|
|
|
}
|
|
|
|
|
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]),"
|
2023-02-01 17:53:58 +00:00
|
|
|
FILE_CONTENT += " \"qtDataDirectory\": $$emitString($$relative_path($$[QT_INSTALL_DATA], $$[QT_INSTALL_PREFIX])),"
|
|
|
|
FILE_CONTENT += " \"qtLibExecsDirectory\": $$emitString($$relative_path($$[QT_INSTALL_LIBEXECS], $$[QT_INSTALL_PREFIX])),"
|
|
|
|
FILE_CONTENT += " \"qtLibsDirectory\": $$emitString($$relative_path($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])),"
|
|
|
|
FILE_CONTENT += " \"qtPluginsDirectory\": $$emitString($$relative_path($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX])),"
|
|
|
|
FILE_CONTENT += " \"qtQmlDirectory\": $$emitString($$relative_path($$[QT_INSTALL_QML], $$[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
|
|
|
|
2019-08-01 05:56:59 +00:00
|
|
|
FILE_CONTENT += " \"toolchain-prefix\": \"llvm\","
|
|
|
|
FILE_CONTENT += " \"tool-prefix\": \"llvm\","
|
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
|
|
|
|
2019-08-01 05:56:59 +00:00
|
|
|
for (arch, ANDROID_ABIS) {
|
|
|
|
equals(arch, x86): libs_arch = i686-linux-android
|
|
|
|
else: equals(arch, x86_64): libs_arch = x86_64-linux-android
|
|
|
|
else: equals(arch, arm64-v8a): libs_arch = aarch64-linux-android
|
|
|
|
else: libs_arch = arm-linux-androideabi
|
|
|
|
ARCHS += "$$emitString($$arch):$$emitString($$libs_arch)"
|
|
|
|
}
|
|
|
|
FILE_CONTENT += " \"architectures\": {$$join(ARCHS,", ")},"
|
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
|
|
|
|
2018-10-15 07:23:26 +00:00
|
|
|
# Android-specific version string
|
|
|
|
!isEmpty(ANDROID_VERSION_NAME): \
|
|
|
|
FILE_CONTENT += " \"android-version-name\": $$emitString($$ANDROID_VERSION_NAME),"
|
|
|
|
|
|
|
|
# Android-specific version number
|
|
|
|
!isEmpty(ANDROID_VERSION_CODE): \
|
|
|
|
FILE_CONTENT += " \"android-version-code\": $$emitString($$ANDROID_VERSION_CODE),"
|
|
|
|
|
2020-03-02 15:00:04 +00:00
|
|
|
!isEmpty(ANDROID_MIN_SDK_VERSION): \
|
|
|
|
FILE_CONTENT += " \"android-min-sdk-version\": $$emitString($$ANDROID_MIN_SDK_VERSION),"
|
|
|
|
|
|
|
|
!isEmpty(ANDROID_TARGET_SDK_VERSION): \
|
|
|
|
FILE_CONTENT += " \"android-target-sdk-version\": $$emitString($$ANDROID_TARGET_SDK_VERSION),"
|
|
|
|
|
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
|
|
|
|
2022-08-15 16:47:31 +00:00
|
|
|
tool_extension = ""
|
|
|
|
contains(QMAKE_HOST.os, Windows): tool_extension = ".exe"
|
|
|
|
FILE_CONTENT += " \"rcc-binary\": $$emitString($$[QT_HOST_LIBEXECS]/rcc$${tool_extension}),"
|
2020-09-22 14:07:55 +00:00
|
|
|
|
2022-10-04 15:12:39 +00:00
|
|
|
contains(QT_MODULES, qml) {
|
|
|
|
FILE_CONTENT += " \"qml-importscanner-binary\": $$emitString($$[QT_HOST_LIBEXECS]/qmlimportscanner$${tool_extension}),"
|
|
|
|
|
|
|
|
qml_import_paths = $$(QML2_IMPORT_PATH)
|
|
|
|
qml_import_paths = $$split(qml_import_paths, $$DIRLIST_SEPARATOR)
|
|
|
|
qml_import_paths += $$QML_IMPORT_PATH
|
|
|
|
!isEmpty(qml_import_paths) {
|
|
|
|
FILE_CONTENT += " \"qml-import-paths\": $$emitString($$join(qml_import_paths, ",")),"
|
|
|
|
}
|
|
|
|
unset(qml_import_paths)
|
|
|
|
|
|
|
|
|
|
|
|
isEmpty(QML_ROOT_PATH): \
|
|
|
|
QML_ROOT_PATH = $$_PRO_FILE_PWD_
|
|
|
|
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
|
|
|
|
} else {
|
|
|
|
FILE_CONTENT += " \"qml-skip-import-scanning\": true,"
|
2020-04-13 14:06:24 +00:00
|
|
|
}
|
2014-07-22 08:01:01 +00:00
|
|
|
|
2020-08-13 14:39:22 +00:00
|
|
|
!isEmpty(ANDROID_APPLICATION_ARGUMENTS): \
|
|
|
|
FILE_CONTENT += " \"android-application-arguments\": $$emitString($$ANDROID_APPLICATION_ARGUMENTS),"
|
|
|
|
|
2017-07-28 13:52:31 +00:00
|
|
|
FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH),"
|
2019-12-12 08:50:16 +00:00
|
|
|
!isEmpty(RESOURCES)|!isEmpty(QMLCACHE_RESOURCE_FILES) {
|
2019-10-23 05:48:04 +00:00
|
|
|
# Make sure that qmake generated qrc files are accounted for
|
|
|
|
load(resources_functions)
|
|
|
|
qtFlattenResources()
|
2019-12-12 08:50:16 +00:00
|
|
|
NEWRESOURCES = $$RESOURCES $$QMLCACHE_RESOURCE_FILES
|
|
|
|
for(resource, NEWRESOURCES) {
|
2020-06-08 07:44:50 +00:00
|
|
|
contains(resource, ".*qmake_qmake_immediate\\.qrc$") {
|
2019-10-23 05:48:04 +00:00
|
|
|
# They will be created for each architecture, since they could be different
|
|
|
|
# we need to account for all of them
|
2021-09-02 13:16:02 +00:00
|
|
|
qmake_qrc_path = "qmake_qmake_immediate.qrc"
|
|
|
|
base_out_path = $$OUT_PWD/$$RCC_DIR
|
|
|
|
multi_android_abi {
|
|
|
|
for (arch, ANDROID_ABIS): \
|
|
|
|
rescopy += $$absolute_path($$qmake_qrc_path, $$base_out_path/$$arch)
|
|
|
|
} else {
|
|
|
|
rescopy += $$absolute_path($$qmake_qrc_path, $$base_out_path)
|
|
|
|
}
|
2019-10-23 05:48:04 +00:00
|
|
|
} else {
|
|
|
|
contains(resource, ".*\\.qrc$"): rescopy += $$absolute_path($$resource, $$_PRO_FILE_PWD_)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FILE_CONTENT += " \"qrcFiles\": $$emitString($$join(rescopy, ",")),"
|
|
|
|
}
|
2019-08-01 05:56:59 +00:00
|
|
|
FILE_CONTENT += ""
|
2020-08-14 13:41:30 +00:00
|
|
|
FILE_CONTENT += " \"application-binary\": $$emitString($$TARGET_FOR_ANDROID_DEPLOYMENT_SETTINGS)"
|
2013-09-05 11:18:15 +00:00
|
|
|
FILE_CONTENT += "}"
|
|
|
|
|
2020-08-14 13:41:30 +00:00
|
|
|
isEmpty(ANDROID_DEPLOYMENT_SETTINGS_FILE): ANDROID_DEPLOYMENT_SETTINGS_FILE = $$OUT_PWD/android-$$TARGET_FOR_ANDROID_DEPLOYMENT_SETTINGS-deployment-settings.json
|
2013-09-05 11:18:15 +00:00
|
|
|
|
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
|
|
|
}
|