Go to file
Alexandru Croitor c89da21249 CMake: Fix cross-building examples in prefix builds as ExternalProjects
For examples to successfully find not yet installed Config files in a
prefix cross-build, both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH
need to be adjusted when toolchain files set
CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY.

Before this change, we lacked two things.

1) If the chain-loaded toolchain file sets CMAKE_FIND_ROOT_PATH
(instead of appending), then the initial value of CMAKE_FIND_ROOT_PATH
that was passed by ExternalProject's initial cache would be
overridden.

2) The prefixes we passed via QT_EXAMPLES_CMAKE_PREFIX_PATH did not
end in lib/cmake, to work around the path re-rooting problem in CMake.

We can handle both of these points by using
QT_ADDITIONAL_PACKAGES_PREFIX_PATH which was introduced for Conan
usage.

Each value assigned to QT_ADDITIONAL_PACKAGES_PREFIX_PATH
gets prepended to CMAKE_FIND_ROOT_PATH by qt.toolchain.cmake AFTER the
original toolchain file is chain-loaded.

And each value also gets lib/cmake appended and assigned to
both CMAKE_PREFIX_PATH and _qt_additional_packages_prefix_paths (used
by Qt6Config.cmake.in to work with find_package + NO_DEFAULT_PATH).

This is exactly what we need to ensure examples build.

Pick-to: 6.2 6.3
Task-number: QTBUG-96232
Change-Id: I11a52457ff795a6661a3a7b68e823e0615d0ce89
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-16 15:56:16 +01:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Provide a qtpaths wrapper script when cross-building Qt 2021-11-08 13:41:03 +01:00
cmake CMake: Fix cross-building examples in prefix builds as ExternalProjects 2022-03-16 15:56:16 +01:00
coin coin: Preserve quoted arguments when calling cmake / configure 2022-03-11 02:43:46 +01:00
config.tests CMake: add detection of x86 VAES and AVX512VBMI2 features 2022-03-08 00:31:30 -08:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Doc: Use \QtVersion macro to display correct version in code snippet 2022-03-14 16:13:06 +01:00
examples Compose render-to-texture widgets through QRhi 2022-03-11 21:25:00 +01:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec syncqt: Do not print info about generating deprecated headers by default 2022-03-16 00:30:34 +01:00
mkspecs Enable -mno-direct-extern-access and ELF protected visibility 2022-03-10 17:10:57 -08:00
qmake Deprecate {QString, QByteArray}::count() 2022-03-12 01:05:45 +01:00
src QMainWindow: Fix unused separator widgets blocking mouse events 2022-03-16 09:50:52 +01:00
tests QObject: give some TLC to dumpRecursive() 2022-03-16 02:26:56 +00:00
util pro2cmake: Introduce qmake2cmake convenience scripts 2022-03-08 03:45:30 +01:00
.cmake.conf Bump version to 6.4.0 2022-01-31 17:20:06 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Use REALPATH based check for symbolic links on Windows 2022-01-07 14:31:38 +01:00
conanfile.py Conan: Include Android specific option values in 'package_id' 2022-03-01 00:01:04 +00:00
config_help.txt configure: CMake: Add -no-prefix option 2022-02-24 19:46:01 +01:00
configure Remove unsupported, host-related options from configure shell script 2021-08-05 02:44:27 +02:00
configure.bat configure.bat: Fix call without arguments 2022-02-16 12:05:48 +01:00
configure.cmake Enable -mno-direct-extern-access and ELF protected visibility 2022-03-10 17:10:57 -08:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
LICENSE.FDL Remove trailing whitespace in LICENSE.FDL 2021-11-26 18:28:49 +01:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.QT-LICENSE-AGREEMENT Update LICENSE.QT-LICENSE-AGREEMENT 2022-02-16 17:19:34 +02:00
qt_cmdline.cmake configure: CMake: Add -no-prefix option 2022-02-24 19:46:01 +01:00
sync.profile Network: Use public suffix database in DAFSA format 2022-02-24 19:36:26 +01:00