diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp index 6ffa52e8699d5046aafcfd377cec2c809247045a..25048dea339922ae71b81913b7e43a6d3f17d5b4 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp @@ -66,6 +66,8 @@ #include <QtGui/QCheckBox> #include <QtGui/QToolButton> #include <QtGui/QComboBox> +#include <QtCore/QFileInfo> +#include <QtCore/QDir> using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager; @@ -607,9 +609,19 @@ Utils::Environment Qt4RunConfiguration::baseEnvironment() const // to find those libraries while actually running we explicitly prepend those // 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.prependOrSetLibrarySearchPath(dir); + if (node) { + const QStringList libDirectories = node->variableValue(LibDirectoriesVar); + if (!libDirectories.isEmpty()) { + const QString proDirectory = QFileInfo(node->path()).absolutePath(); + foreach (QString dir, libDirectories) { + // Fix up relative entries like "LIBS+=-L.." + const QFileInfo fi(dir); + if (!fi.isAbsolute()) + dir = QDir::cleanPath(proDirectory + QLatin1Char('/') + dir); + env.prependOrSetLibrarySearchPath(dir); + } // foreach + } // libDirectories + } // node return env; }