diff --git a/recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch b/recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch similarity index 50% rename from recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch rename to recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch index 7aa108e..2d370e0 100644 --- a/recipes-qt/qt6/qtbase/0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch +++ b/recipes-qt/qt6/qtbase/0004-Fix-qt.toolchain.cmake-for-SDK-use.patch @@ -1,22 +1,25 @@ -From c15033fd4df14b08fc28ec8da61c990801c7e411 Mon Sep 17 00:00:00 2001 +From e9bb85a781536a048adc85b1ec5a02d7d10d21fb Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 16 Dec 2021 13:10:48 +0200 -Subject: [PATCH] Do not use QT_TOOLCHAIN_RELOCATABLE paths in - qt.toolchain.cmake +Subject: [PATCH] Fix qt.toolchain.cmake for SDK use + +Set initial host path based on the location of the qt.toolchain.cmake file. +This helps us avoid need to relocate the file in SDK. The calculated paths for QT_TOOLCHAIN_RELOCATABLE paths point to host sysroot which must not be used when cross-compiling other projects. +Change-Id: I52aa2a10d2a13fd27d6bf8b4af6dc1833c7a286a Upstream-Status: Inappropriate [embedded specific] --- - cmake/qt.toolchain.cmake.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + cmake/qt.toolchain.cmake.in | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in -index 5e9acd66b8..451de99633 100644 +index 6e37ae0281..1eba4d8c7c 100644 --- a/cmake/qt.toolchain.cmake.in +++ b/cmake/qt.toolchain.cmake.in -@@ -68,8 +68,8 @@ get_filename_component(QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR "${CMAKE_CURRENT_LIST_ +@@ -71,8 +71,8 @@ get_filename_component(QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR "${CMAKE_CURRENT_LIST_ # Instead of collapsing the search prefix (which is the case when one is a subdir of the other), # it concatenates them creating an invalid path. Workaround it by setting the root path to the # Qt install prefix, and the prefix path to the lib/cmake subdir. @@ -27,3 +30,18 @@ index 5e9acd66b8..451de99633 100644 # Let CMake load our custom platform modules. # CMake-provided platform modules take precedence. +@@ -162,10 +162,10 @@ if(DEFINED QT_REQUIRE_HOST_PATH_CHECK) + else() + set(__qt_toolchain_host_path_required "@qt_host_path_required@") + endif() +-set(__qt_toolchain_initial_qt_host_path +- "@qt_host_path_absolute@") +-set(__qt_toolchain_initial_qt_host_path_cmake_dir +- "@qt_host_path_cmake_dir_absolute@") ++get_filename_component(__qt_toolchain_initial_qt_host_path ++ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE) ++get_filename_component(__qt_toolchain_initial_qt_host_path_cmake_dir ++ "${CMAKE_CURRENT_LIST_DIR}/../../../lib/cmake" ABSOLUTE) + + # QT_HOST_PATH precedence: + # - cache variable / command line option diff --git a/recipes-qt/qt6/qtbase_git.bb b/recipes-qt/qt6/qtbase_git.bb index 97b72c4..ed7c2de 100644 --- a/recipes-qt/qt6/qtbase_git.bb +++ b/recipes-qt/qt6/qtbase_git.bb @@ -18,7 +18,7 @@ SRC_URI += "\ file://0001-Add-linux-oe-g-platform.patch \ file://0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \ file://0003-tests-disable-failing-tests.patch \ - file://0004-Do-not-use-QT_TOOLCHAIN_RELOCATABLE-paths-in-qt.tool.patch \ + file://0004-Fix-qt.toolchain.cmake-for-SDK-use.patch \ " DEPENDS += "\ @@ -167,7 +167,6 @@ EOF RELPATH=${@os.path.relpath(d.getVar('prefix') + '/share/cmake/Qt6Toolchain.cmake', d.getVar('QT6_INSTALL_LIBDIR') + '/cmake/Qt6')} sed -i ${D}${QT6_INSTALL_LIBDIR}/cmake/Qt6/qt.toolchain.cmake \ - -e 's|${RECIPE_SYSROOT_NATIVE}|\${CMAKE_CURRENT_LIST_DIR}/../../../..|' \ -e "s|/.*/toolchain.cmake|\${CMAKE_CURRENT_LIST_DIR}/$RELPATH|" }