diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-04-30 06:13:03 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-05-14 21:36:59 +0200 |
commit | 786ae0141a524c66e01e652aed0e6ed4c97d08bc (patch) | |
tree | cf73561634765b64cc15ec3e2d35097037b39507 /mkspecs | |
parent | 76fe36645eb41fa35e526a97874f1e15a39c3823 (diff) |
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 <eb@emlix.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/cmake_functions.prf | 9 |
1 files changed, 8 insertions, 1 deletions
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, ";")) } |