c89da21249
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> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
LICENSE.FDL | ||
LICENSE.GPL2 | ||
LICENSE.GPL3 | ||
LICENSE.GPL3-EXCEPT | ||
LICENSE.LGPL3 | ||
LICENSE.QT-LICENSE-AGREEMENT | ||
qt_cmdline.cmake | ||
sync.profile |