diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 193c148e8b..90349aad87 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -73,6 +73,17 @@ function(qt6_android_generate_deployment_settings target) _qt_is_android_generate_deployment_settings_called TRUE ) + get_target_property(android_executable_finalizer_called + ${target} _qt_android_executable_finalizer_called) + + if(android_executable_finalizer_called) + # Don't show deprecation when called by our own function implementations. + else() + message(DEPRECATION + "Calling qt_android_generate_deployment_settings directly is deprecated since Qt 6.5. " + "Use qt_add_executable instead.") + endif() + get_target_property(target_type ${target} TYPE) if (NOT "${target_type}" STREQUAL "MODULE_LIBRARY") @@ -327,6 +338,16 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) endif() function(qt6_android_apply_arch_suffix target) + get_target_property(called_from_qt_impl + ${target} _qt_android_apply_arch_suffix_called_from_qt_impl) + if(called_from_qt_impl) + # Don't show deprecation when called by our own function implementations. + else() + message(DEPRECATION + "Calling qt_android_apply_arch_suffix directly is deprecated since Qt 6.5. " + "Use qt_add_executable or qt_add_library instead.") + endif() + get_target_property(target_type ${target} TYPE) if (target_type STREQUAL "SHARED_LIBRARY" OR target_type STREQUAL "MODULE_LIBRARY") set_property(TARGET "${target}" PROPERTY SUFFIX "_${CMAKE_ANDROID_ARCH_ABI}.so") @@ -349,6 +370,17 @@ function(qt6_android_add_apk_target target) return() endif() + get_target_property(android_executable_finalizer_called + ${target} _qt_android_executable_finalizer_called) + + if(android_executable_finalizer_called) + # Don't show deprecation when called by our own function implementations. + else() + message(DEPRECATION + "Calling qt_android_add_apk_target directly is deprecated since Qt 6.5. " + "Use qt_add_executable instead.") + endif() + get_target_property(deployment_file ${target} QT_ANDROID_DEPLOYMENT_SETTINGS_FILE) if (NOT deployment_file) message(FATAL_ERROR "Target ${target} is not a valid android executable target\n") @@ -1198,6 +1230,8 @@ endfunction() # package for the executable 'target'. The function is added to the finalizer list of the Core # module and is executed implicitly when configuring user projects. function(_qt_internal_android_executable_finalizer target) + set_property(TARGET ${target} PROPERTY _qt_android_executable_finalizer_called TRUE) + _qt_internal_configure_android_multiabi_target("${target}") qt6_android_generate_deployment_settings("${target}") qt6_android_add_apk_target("${target}") diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 1820836ff1..f5e93d6b14 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -580,6 +580,8 @@ function(_qt_internal_create_executable target) set_property(TARGET "${target}" PROPERTY CXX_VISIBILITY_PRESET default) set_property(TARGET "${target}" PROPERTY OBJC_VISIBILITY_PRESET default) set_property(TARGET "${target}" PROPERTY OBJCXX_VISIBILITY_PRESET default) + set_property(TARGET "${target}" + PROPERTY _qt_android_apply_arch_suffix_called_from_qt_impl TRUE) qt6_android_apply_arch_suffix("${target}") set_property(TARGET "${target}" PROPERTY _qt_is_android_executable TRUE) else() @@ -2282,6 +2284,8 @@ function(_qt_internal_add_library target) endif() if(ANDROID) + set_property(TARGET "${target}" + PROPERTY _qt_android_apply_arch_suffix_called_from_qt_impl TRUE) qt6_android_apply_arch_suffix("${target}") endif() endfunction() diff --git a/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc b/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc index 747849eabb..4ab9b3d53d 100644 --- a/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc +++ b/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc @@ -13,7 +13,7 @@ \include cmake-find-package-core.qdocinc \cmakecommandsince 6.0 -\preliminarycmakecommand +\warning This command is deprecated since Qt 6.5. Use \l qt_add_executable instead. \cmakecommandandroidonly \section1 Synopsis diff --git a/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc b/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc index 4d4585693d..363bba1097 100644 --- a/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc +++ b/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc @@ -13,7 +13,8 @@ \include cmake-find-package-core.qdocinc \cmakecommandsince 6.0 -\preliminarycmakecommand +\warning This command is deprecated since Qt 6.5. Use \l qt_add_executable +or \l qt_add_library instead. \cmakecommandandroidonly \section1 Synopsis diff --git a/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc b/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc index a717c80e7c..d71fa092f8 100644 --- a/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc +++ b/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc @@ -13,7 +13,7 @@ \include cmake-find-package-core.qdocinc \cmakecommandsince 6.0 -\preliminarycmakecommand +\warning This command is deprecated since Qt 6.5. Use \l qt_add_executable instead. \cmakecommandandroidonly \section1 Synopsis