From 0274daf30779ba08fc708247a3e645fd44980280 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 23 Nov 2020 16:19:39 +0100 Subject: [PATCH] CMake: Rename QtBuildInternalsAndroid.cmake to QtAndroidHelpers.cmake ...and include it in QtBuild.cmake. Commit e8d8b1a5e4c added two different code paths to include QtBuildInternalsAndroid.cmake. This was needed, because: In a top-level build, we must not include files that are not yet installed. We have the source tree available, and "${QT_SOURCE_TREE}/cmake" is in CMAKE_MODULE_PATH. We can use the "module syntax" of the include() command. In a per-repository build, when building against an installed qtbase, we must not include files of the source tree, because that's not guaranteed to be available. However, Qt6BuildInternalsConfig.cmake is installed, and we can directly include QtBuildInternalsAndroid.cmake, which is right next to it. We can circumvent this whole issue by moving the Android-related functions out of the Qt6BuildInternals package and including it in QtBuild.cmake. Pick-to: 6.0 Task-number: QTBUG-88718 Change-Id: I5192ba19bb77952505c20d053d7285f798d16ac5 Reviewed-by: Alexandru Croitor --- ...uildInternalsAndroid.cmake => QtAndroidHelpers.cmake} | 2 -- cmake/QtBaseGlobalTargets.cmake | 5 +---- cmake/QtBuild.cmake | 4 ++++ cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 9 --------- 4 files changed, 5 insertions(+), 15 deletions(-) rename cmake/{QtBuildInternals/QtBuildInternalsAndroid.cmake => QtAndroidHelpers.cmake} (99%) diff --git a/cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake b/cmake/QtAndroidHelpers.cmake similarity index 99% rename from cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake rename to cmake/QtAndroidHelpers.cmake index 1d3997b0c9..7e84c983a9 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake +++ b/cmake/QtAndroidHelpers.cmake @@ -212,5 +212,3 @@ function(qt_android_dependencies target) COMPONENT Devel) endfunction() - - diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 73bc83aca0..1f12b7206a 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -57,10 +57,6 @@ qt_install(FILES DESTINATION "${__build_internals_install_dir}" COMPONENT Devel ) -qt_copy_or_install( - FILES - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake" - DESTINATION "${__build_internals_install_dir}") qt_copy_or_install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}" @@ -149,6 +145,7 @@ qt_copy_or_install(FILES cmake/ModuleDescription.json.in cmake/Qt3rdPartyLibraryConfig.cmake.in cmake/Qt3rdPartyLibraryHelpers.cmake + cmake/QtAndroidHelpers.cmake cmake/QtAppHelpers.cmake cmake/QtAutogenHelpers.cmake cmake/QtBuild.cmake diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index e62294c045..1252ed2c3c 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -490,5 +490,9 @@ include(QtToolHelpers) include(QtHeadersClean) include(QtJavaHelpers) +if(ANDROID) + include(QtAndroidHelpers) +endif() + # This sets up the scope finalizer mechanism. variable_watch(CMAKE_CURRENT_LIST_DIR qt_watch_current_list_dir) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index bb2de0a0c2..d930e2a963 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -568,12 +568,3 @@ macro(qt_examples_build_end) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}) endmacro() - -if (ANDROID) - if(QT_SUPERBUILD) - include(QtBuildInternals/QtBuildInternalsAndroid) - else() - ### TODO: Find out why this is needed. See QTBUG-88718. - include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsAndroid.cmake) - endif() -endif()