sdk: Use correct CMAKE_PREFIX_PATH for Qt modules

Building Qt modules uses extra CMake instructions that try to be clever
about which CMAKE_PREFIX_PATH to use. With SDK, these instructions end
up using the SDK host paths in the device instead of the actual device
paths. Add CMake option to prevent Qt from changing the default prefix.

Fixes: QTBUG-103577
Change-Id: Ia933c843d811e6adb2ed4ede4708f55a6f0e8f0c
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
(cherry picked from commit ec7e50bbaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Samuli Piippo 2022-05-18 05:21:03 +00:00 committed by Qt Cherry-pick Bot
parent a3ba4ebb64
commit 86ae133ab2
2 changed files with 2 additions and 0 deletions

View File

@ -131,6 +131,7 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()
set(CMAKE_INSTALL_PREFIX "${prefix}" CACHE PATH "Install path prefix")
set(QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX ON CACHE BOOL "")
EOF
# resolve absolute paths at runtime

View File

@ -157,6 +157,7 @@ do_install:append:class-nativesdk() {
install -d ${D}${datadir}/cmake/OEToolchainConfig.cmake.d
cat > ${D}${datadir}/cmake/OEToolchainConfig.cmake.d/OEQt6Toolchain.cmake <<EOF
set(QT_HOST_PATH "\$ENV{OECORE_NATIVE_SYSROOT}/usr" CACHE PATH "")
set(QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX ON CACHE BOOL "")
EOF
RELPATH="${@os.path.relpath(d.getVar('bindir'), d.getVar('QT6_INSTALL_BINDIR'))}"