diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-09-14 15:38:56 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-19 19:54:44 +0200 |
commit | aad3410864887d59ecd7d43ae7cf646a20b13c2b (patch) | |
tree | 87124d910b09a8719c891bea9f8062377ca5ca27 /mkspecs/features | |
parent | 4ac264117a178dc2fbee11aca4b58bc4073e737b (diff) |
factor out qtAddTargetEnv()
Change-Id: Ib0517da54da98de4b1f2ee7d80bee22316231091
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/qt_functions.prf | 31 | ||||
-rw-r--r-- | mkspecs/features/qt_tool.prf | 30 |
2 files changed, 32 insertions, 29 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 58c35ddd41..c700a37e5a 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -204,6 +204,37 @@ defineTest(qtAddToolEnv) { export($$1) } +defineTest(qtAddTargetEnv) { + deps = $$resolve_depends(QT, "QT.") + !isEmpty(deps) { + plugin_paths = + for(dep, deps) { + deppath += $$shell_path($$eval(QT.$${dep}.libs)) + for(rpath, QT.$${dep}.rpath_link): \ + deppath += $$shell_path($$rpath) + plugin_paths += $$eval(QT.$${dep}.plugin_path) $$eval(QT.$${dep}.plugins) + } + equals(QMAKE_HOST.os, Windows): \ + deppath.name = PATH + else:contains(QMAKE_HOST.os, Linux|FreeBSD): \ + deppath.name = LD_LIBRARY_PATH + else:equals(QMAKE_HOST.os, Darwin): \ + deppath.name = DYLD_LIBRARY_PATH + else: \ + error("Operating system not supported.") + deppath.value = $$unique(deppath) + deppath.CONFIG = prepend + pluginpath.name = QT_PLUGIN_PATH + pluginpath.value = + plugin_paths = $$unique(plugin_paths) + for(ppath, plugin_paths): \ + exists($$ppath): \ + pluginpath.value += $$shell_path($$ppath) + QT_TOOL_ENV += deppath pluginpath + } + qtAddToolEnv($$1, $$QT_TOOL_ENV) +} + defineReplace(pkgConfigExecutable) { isEmpty(PKG_CONFIG) { PKG_CONFIG = pkg-config diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index b52362a9b0..01a26b238e 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -33,35 +33,7 @@ INSTALLS += target load(resolve_target) cmd = $$shell_path($$QMAKE_RESOLVED_TARGET) - deps = $$resolve_depends(QT, "QT.") - !isEmpty(deps) { - plugin_paths = - for(dep, deps) { - deppath += $$shell_path($$eval(QT.$${dep}.libs)) - for(rpath, QT.$${dep}.rpath_link): \ - deppath += $$shell_path($$rpath) - plugin_paths += $$eval(QT.$${dep}.plugin_path) $$eval(QT.$${dep}.plugins) - } - equals(QMAKE_HOST.os, Windows): \ - deppath.name = PATH - else:contains(QMAKE_HOST.os, Linux|FreeBSD): \ - deppath.name = LD_LIBRARY_PATH - else:equals(QMAKE_HOST.os, Darwin): \ - deppath.name = DYLD_LIBRARY_PATH - else: \ - error("Operating system not supported.") - deppath.value = $$unique(deppath) - deppath.CONFIG = prepend - pluginpath.name = QT_PLUGIN_PATH - pluginpath.value = - plugin_paths = $$unique(plugin_paths) - for(ppath, plugin_paths): \ - exists($$ppath): \ - pluginpath.value += $$shell_path($$ppath) - QT_TOOL_ENV += deppath pluginpath - } - - qtAddToolEnv(cmd, $$QT_TOOL_ENV) + qtAddTargetEnv(cmd) TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_$${MODULE}.pri |