786ae0141a
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>
78 lines
1.7 KiB
Plaintext
78 lines
1.7 KiB
Plaintext
#
|
|
# W A R N I N G
|
|
# -------------
|
|
#
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
# implementation detail. It may change from version to version
|
|
# without notice, or even be removed.
|
|
#
|
|
# We mean it.
|
|
#
|
|
|
|
defineReplace(cmakeModuleName) {
|
|
_module = $$1
|
|
_name = $$eval(QT.$${_module}.name)
|
|
cmake_module_name = $$replace(_name, ^Qt, )
|
|
return ($$cmake_module_name)
|
|
}
|
|
|
|
defineReplace(cmakeModuleList) {
|
|
variable = $$1
|
|
out =
|
|
for(v, variable) {
|
|
out += $$cmakeModuleName($$v)
|
|
}
|
|
return ($$join(out, ";"))
|
|
}
|
|
|
|
defineReplace(cmakeTargetPath) {
|
|
SYSR = $$[QT_SYSROOT]
|
|
!isEmpty(SYSR): path = /$$relative_path($$1, $$[QT_SYSROOT])
|
|
else: path = $$1
|
|
return($$clean_path($$path))
|
|
}
|
|
|
|
defineReplace(cmakeTargetPaths) {
|
|
variable = $$1
|
|
out =
|
|
for(v, variable) {
|
|
out += \"$$cmakeTargetPath($$v)\"
|
|
}
|
|
return ($$join(out, " "))
|
|
}
|
|
|
|
defineReplace(cmakePortablePaths) {
|
|
SYSR = $$[QT_SYSROOT]
|
|
!isEmpty(SYSR): SYSR = ${CMAKE_SYSROOT}
|
|
variable = $$1
|
|
out =
|
|
for(v, variable) {
|
|
path = $$cmakeTargetPath($$v)
|
|
contains(path, /.*): \
|
|
sysroot_prefix = $$SYSR
|
|
else: \
|
|
sysroot_prefix = $$SYSR/
|
|
out += $${sysroot_prefix}$${path}
|
|
}
|
|
return ($$join(out, ";"))
|
|
}
|
|
|
|
defineReplace(cmakeProcessLibs) {
|
|
variable = $$1
|
|
out =
|
|
for(v, variable) {
|
|
if(!equals(v, -framework):!contains(v, -L.*)) {
|
|
v ~= s,^-l,,
|
|
v ~= s,^-lib,,
|
|
v ~= s,.lib$,,
|
|
out += $$v
|
|
}
|
|
}
|
|
return ($$join(out, ";"))
|
|
}
|
|
|
|
defineReplace(cmakeRelativePath) {
|
|
path = $$relative_path($$1, $$2)
|
|
return($$replace(path, ([^/])$, \\1/))
|
|
}
|