prependOrSet(QLatin1String("PATH"), QDir::toNativeSeparators(value), QString(sep));
}
+void Environment::prependOrSetLibrarySearchPath(const QString &value)
+{
+#ifdef Q_OS_WIN
+ const QChar sep = QLatin1Char(';');
+#else
+ const QChar sep = QLatin1Char(':');
+#endif
+
+#ifdef Q_OS_WIN
+ const QLatin1String path("PATH");
+#elif defined(Q_OS_MAC)
+ const QLatin1String path("DYLD_LIBRARY_PATH");
+#elif defined(Q_OS_UNIX)
+ const QLatin1String path("LD_LIBRARY_PATH");
+#else
+ return;
+#endif
+
+ prependOrSet(path, QDir::toNativeSeparators(value), QString(sep));
+}
+
Environment Environment::systemEnvironment()
{
return Environment(QProcess::systemEnvironment());
void appendOrSetPath(const QString &value);
void prependOrSetPath(const QString &value);
+ void prependOrSetLibrarySearchPath(const QString &value);
+
void clear();
int size() const;
env.set("DYLD_IMAGE_SUFFIX", "_debug");
}
-#ifdef Q_OS_WIN
- // On windows the user could be linking to a library found via a -L/some/dir switch
+ // The user could be linking to a library found via a -L/some/dir switch
// to find those libraries while actually running we explicitly prepend those
- // dirs to the path
+ // dirs to the library search path
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
if (node)
foreach(const QString &dir, node->variableValue(LibDirectoriesVar))
- env.prependOrSetPath(dir);
-#endif
+ env.prependOrSetLibrarySearchPath(dir);
return env;
}
// Generic:
env.set("QTDIR", QDir::toNativeSeparators(versionInfo().value("QT_INSTALL_DATA")));
env.prependOrSetPath(versionInfo().value("QT_INSTALL_BINS"));
+ env.prependOrSetLibrarySearchPath(versionInfo().value("QT_INSTALL_LIBS"));
// Symbian specific:
if (supportsTargetId(Constants::S60_DEVICE_TARGET_ID)