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, ";")) }