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 <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-11-23 16:19:39 +01:00
parent 2548438e32
commit 0274daf307
4 changed files with 5 additions and 15 deletions

View File

@ -212,5 +212,3 @@ function(qt_android_dependencies target)
COMPONENT COMPONENT
Devel) Devel)
endfunction() endfunction()

View File

@ -57,10 +57,6 @@ qt_install(FILES
DESTINATION "${__build_internals_install_dir}" DESTINATION "${__build_internals_install_dir}"
COMPONENT Devel COMPONENT Devel
) )
qt_copy_or_install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake"
DESTINATION "${__build_internals_install_dir}")
qt_copy_or_install( qt_copy_or_install(
DIRECTORY DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}" "${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/ModuleDescription.json.in
cmake/Qt3rdPartyLibraryConfig.cmake.in cmake/Qt3rdPartyLibraryConfig.cmake.in
cmake/Qt3rdPartyLibraryHelpers.cmake cmake/Qt3rdPartyLibraryHelpers.cmake
cmake/QtAndroidHelpers.cmake
cmake/QtAppHelpers.cmake cmake/QtAppHelpers.cmake
cmake/QtAutogenHelpers.cmake cmake/QtAutogenHelpers.cmake
cmake/QtBuild.cmake cmake/QtBuild.cmake

View File

@ -490,5 +490,9 @@ include(QtToolHelpers)
include(QtHeadersClean) include(QtHeadersClean)
include(QtJavaHelpers) include(QtJavaHelpers)
if(ANDROID)
include(QtAndroidHelpers)
endif()
# This sets up the scope finalizer mechanism. # This sets up the scope finalizer mechanism.
variable_watch(CMAKE_CURRENT_LIST_DIR qt_watch_current_list_dir) variable_watch(CMAKE_CURRENT_LIST_DIR qt_watch_current_list_dir)

View File

@ -568,12 +568,3 @@ macro(qt_examples_build_end)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE})
endmacro() 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()