Commit 5e2e09c0 authored by Christian Kandeler's avatar Christian Kandeler

Qbs: Read QBS_BUILD_DIR also at runtime.

This is necessary for people using the binary release.

Change-Id: I3e8821175c00812bdb8c65f0aedb8208894d08b2
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 34f083f1
......@@ -332,8 +332,9 @@ void QbsProject::parse(const QVariantMap &config, const QString &dir)
params.projectFilePath = m_fileName;
params.ignoreDifferentProjectFilePath = false;
qbs::Preferences *prefs = QbsManager::preferences();
params.searchPaths = prefs->searchPaths(QLatin1String(QBS_BUILD_DIR));
params.pluginPaths = prefs->pluginPaths(QLatin1String(QBS_BUILD_DIR));
const QString buildDir = qbsBuildDir();
params.searchPaths = prefs->searchPaths(buildDir);
params.pluginPaths = prefs->pluginPaths(buildDir);
m_qbsSetupProjectJob
= qbs::Project::setupProject(params, m_manager->settings(), m_manager->logSink(), 0);
......@@ -563,5 +564,14 @@ void QbsProject::updateQmlJsCodeModel(const qbs::ProjectData *prj)
modelManager->updateProjectInfo(projectInfo);
}
QString QbsProject::qbsBuildDir() const
{
QString buildDir = Utils::Environment::systemEnvironment()
.value(QLatin1String("QBS_BUILD_DIR"));
if (buildDir.isEmpty())
buildDir = QLatin1String(QBS_BUILD_DIR);
return buildDir;
}
} // namespace Internal
} // namespace QbsProjectManager
......@@ -117,6 +117,7 @@ private:
void updateDocuments(const qbs::ProjectData *prj);
void updateCppCodeModel(const qbs::ProjectData *prj);
void updateQmlJsCodeModel(const qbs::ProjectData *prj);
QString qbsBuildDir() const;
QbsManager *const m_manager;
const QString m_projectName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment