From 786ae0141a524c66e01e652aed0e6ed4c97d08bc Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 30 Apr 2020 06:13:03 +0200 Subject: CMake: Don't hard-code the sysroot in Qt5XXXConfigExtras.cmake Instead of writing the hard-coded sysroot into the .cmake file, write the variable ${CMAKE_SYSROOT}. This makes it possible to relocate the build to a machine where the sysroot is different from the build machine. Fixes: QTBUG-83335 Change-Id: Iaa69feb9a140b050f6b5547929cc940ee0f039ce Reviewed-by: Rolf Eike Beer Reviewed-by: Alexandru Croitor --- mkspecs/features/cmake_functions.prf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mkspecs/features') diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index 1e6b05c78e..0c62b46af3 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -42,10 +42,17 @@ defineReplace(cmakeTargetPaths) { } defineReplace(cmakePortablePaths) { + SYSR = $$[QT_SYSROOT] + !isEmpty(SYSR): SYSR = ${CMAKE_SYSROOT} variable = $$1 out = for(v, variable) { - out += $$[QT_SYSROOT]$$cmakeTargetPath($$v) + path = $$cmakeTargetPath($$v) + contains(path, /.*): \ + sysroot_prefix = $$SYSR + else: \ + sysroot_prefix = $$SYSR/ + out += $${sysroot_prefix}$${path} } return ($$join(out, ";")) } -- cgit v1.2.3