summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_functions.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/qt_functions.prf')
-rw-r--r--mkspecs/features/qt_functions.prf53
1 files changed, 38 insertions, 15 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index e51a3c953e..fe7b29afce 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -118,23 +118,46 @@ defineTest(qtAddModule) {
# variable, default
defineTest(qtPrepareTool) {
- MODBASE = $$[QT_HOST_BINS/get]
- count(ARGS, 2, greaterThan) {
- isEmpty(QT.$${3}.bins):warning("No QT.$${3}.bins, module path ignored for qtPrepareTool($$1, $$2, $$3)")
- else:MODBASE = $$eval(QT.$${3}.bins)
+ $$1 = $$eval(QT_TOOL.$${2}.binary)
+ isEmpty($$1) {
+ MODBASE = $$[QT_HOST_BINS/get]
+ count(ARGS, 2, greaterThan) {
+ isEmpty(QT.$${3}.bins):warning("No QT.$${3}.bins, module path ignored for qtPrepareTool($$1, $$2, $$3)")
+ else:MODBASE = $$eval(QT.$${3}.bins)
+ }
+ isEmpty($$1):$$1 = $$MODBASE/$$2
+ contains(QMAKE_HOST.os, Windows):!contains($$1, .*\\.(exe|bat)$) {
+ exists($$eval($$1).bat) {
+ $$1 = $$eval($$1).bat
+ } else {
+ $$1 = $$eval($$1).exe
+ }
+ } else:contains(QMAKE_HOST.os, Darwin) {
+ BUNDLENAME = $$eval($$1).app/Contents/MacOS/$$2
+ exists($$BUNDLENAME) {
+ $$1 = $$BUNDLENAME
+ }
+ }
}
- isEmpty($$1):$$1 = $$MODBASE/$$2
- $$1 ~= s,[/\\\\],$$QMAKE_DIR_SEP,
- contains(QMAKE_HOST.os, Windows):!contains($$1, .*\\.(exe|bat)$) {
- exists($$eval($$1).bat) {
- $$1 = $$eval($$1).bat
+ $$1 = $$native_path($$eval($$1))
+
+ deps = $$resolve_depends(QT_TOOL.$${2}.depends, "QT.")
+ !isEmpty(deps) {
+ for(dep, deps): \
+ deppath += $$native_path($$eval(QT.$${dep}.libs))
+ deppath = $$unique(deppath)
+ equals(QMAKE_DIR_SEP, /) {
+ equals(QMAKE_HOST.os, Windows): \
+ var = PATH
+ else:contains(QMAKE_HOST.os, Linux): \
+ var = LD_LIBRARY_PATH
+ else:equals(QMAKE_HOST.os, Darwin): \
+ var = DYLD_LIBRARY_PATH
+ else: \
+ error("Operating system not supported.")
+ $$1 = "$$var=$$join(deppath, :)${$$var:+:\$$$var} $$eval($$1)"
} else {
- $$1 = $$eval($$1).exe
- }
- } else:contains(QMAKE_HOST.os, Darwin) {
- BUNDLENAME = $$eval($$1).app/Contents/MacOS/$$2
- exists($$BUNDLENAME) {
- $$1 = $$BUNDLENAME
+ $$1 = "(set PATH=$$join(deppath, ;);%PATH%) & $$eval($$1)"
}
}