sdk: use relativate path with cmake toolchain file

Paths in mingw toolchain are not relocated when installed, so we
need to use relative path for the Qt6Toolchain.cmake file.

Fixes: QTBUG-100642
Pick-to: 6.3 6.2
Change-Id: I48542f20f4443c8130f89c2436f5b0ecea914bb0
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
This commit is contained in:
Samuli Piippo 2022-02-09 11:36:31 +02:00
parent 92b8d16b73
commit e78c281c0a

View File

@ -97,8 +97,9 @@ include("\${CMAKE_TOOLCHAIN_FILE}")
EOF
# and use that from the default toolchain file qt.toolchain.cmake
RELPATH=${@os.path.relpath('/usr/share/cmake/Qt6Toolchain.cmake', d.getVar('QT6_INSTALL_LIBDIR') + '/cmake/Qt6')}
sed -i ${SDK_OUTPUT}${SDKPATHNATIVE}${QT6_INSTALL_LIBDIR}/cmake/Qt6/qt.toolchain.cmake \
-e 's|/.*/toolchain.cmake|${SDKPATHNATIVE}/usr/share/cmake/Qt6Toolchain.cmake|'
-e "s|/.*/toolchain.cmake|\${CMAKE_CURRENT_LIST_DIR}/$RELPATH|"
}
create_qt6_sdk_files:append:sdkmingw32() {