Add _qt_internal_apk_dependencies if qt_finalize_project is never called

With CMake versions < 3.19, we don't have a deferred call of
qt_finalize_project. In qt_add_executable we only have immediate
finalizaton call of qt_finalize_executable, but
qt_android_generate_deployment_settings still depends on the
_qt_internal_apk_dependencies target that is created by qt_finalize_project only.
Create an empty target for the cases when we need to generate
deployment setting but qt_finalize_project is never called.

Pick-to: 6.4
Fixes: QTBUG-106634
Change-Id: If0608cb527eea662e0f9dd41f2751fe49ce433db
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2022-12-07 13:48:09 +01:00
parent 3cd19719e5
commit 6294ee060e

View File

@ -277,6 +277,12 @@ function(qt6_android_generate_deployment_settings target)
string(APPEND file_contents
" \"extraPrefixDirs\" : [ ${extra_prefix_list} ],\n")
# Create an empty target for the cases when we need to generate deployment setting but
# qt_finalize_project is never called.
if(NOT TARGET _qt_internal_apk_dependencies AND NOT QT_NO_COLLECT_BUILD_TREE_APK_DEPS)
add_custom_target(_qt_internal_apk_dependencies)
endif()
# Extra library paths that could be used as a dependency lookup path by androiddeployqt.
#
# Unlike 'extraPrefixDirs', the 'extraLibraryDirs' key doesn't expect the 'lib' subfolder