From e38c7618be50e16b51cc8afdab52ffb26ed76b0c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 22 Aug 2022 09:35:46 +0200 Subject: [PATCH] CMake: Fix Android build for CMake < 3.19 The Android build used cmake_language(DEFER) and guarded with a check for CMake's version being >= 3.18. However, cmake_language(DEFER) was introduced in CMake 3.19. Fix that version check. Fixes: QTBUG-105841 Pick-to: 6.3 6.4 Change-Id: Ic318c104cf212de4c97c5a89b73536609826fd5b Reviewed-by: Alexandru Croitor --- src/corelib/Qt6AndroidMacros.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index bae0d5528ef..7e1579c7a13 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -554,8 +554,8 @@ endfunction() # The function collects all known non-imported shared libraries that are created in the build tree. # It uses the CMake DEFER CALL feature if the CMAKE_VERSION is greater -# than or equal to 3.18. -# Note: Users that use cmake version less that 3.18 need to call qt_finalize_project +# than or equal to 3.19. +# Note: Users that use cmake version less that 3.19 need to call qt_finalize_project # in the end of a project's top-level CMakeLists.txt. function(_qt_internal_collect_apk_dependencies_defer) # User opted-out the functionality @@ -569,13 +569,14 @@ function(_qt_internal_collect_apk_dependencies_defer) endif() set_property(GLOBAL PROPERTY _qt_is_collect_apk_dependencies_defer_called TRUE) - if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18") + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.19") cmake_language(EVAL CODE "cmake_language(DEFER DIRECTORY \"${CMAKE_SOURCE_DIR}\" CALL _qt_internal_collect_apk_dependencies)") else() # User don't want to see the warning if(NOT QT_NO_WARN_BUILD_TREE_APK_DEPS) - message(WARNING "CMake version you use is less than 3.18. APK dependencies, that are a" + message(WARNING + "The CMake version you use is less than 3.19. APK dependencies, that are a" " part of the project tree, might not be collected correctly." " Please call qt_finalize_project in the end of a project's top-level" " CMakeLists.txt file to make sure that all the APK dependencies are"