forked from qt-creator/qt-creator
Add absolute paths to environment.
Change-Id: I0f23f8d372f3ceb3d4af301196e6fdea5f969998 Reviewed-on: http://codereview.qt.nokia.com/2819 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -66,6 +66,8 @@
|
|||||||
#include <QtGui/QCheckBox>
|
#include <QtGui/QCheckBox>
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
#include <QtGui/QComboBox>
|
#include <QtGui/QComboBox>
|
||||||
|
#include <QtCore/QFileInfo>
|
||||||
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
@@ -607,9 +609,19 @@ Utils::Environment Qt4RunConfiguration::baseEnvironment() const
|
|||||||
// to find those libraries while actually running we explicitly prepend those
|
// to find those libraries while actually running we explicitly prepend those
|
||||||
// dirs to the library search path
|
// dirs to the library search path
|
||||||
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||||
if (node)
|
if (node) {
|
||||||
foreach(const QString &dir, node->variableValue(LibDirectoriesVar))
|
const QStringList libDirectories = node->variableValue(LibDirectoriesVar);
|
||||||
env.prependOrSetLibrarySearchPath(dir);
|
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;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user