Qbs: Read QBS_BUILD_DIR also at runtime.

This is necessary for people using the binary release.

Change-Id: I3e8821175c00812bdb8c65f0aedb8208894d08b2
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Christian Kandeler
2013-02-21 16:21:27 +01:00
parent 34f083f1a4
commit 5e2e09c045
2 changed files with 13 additions and 2 deletions

View File

@@ -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