QbsProjectManager: Support using an installed qbs.

Distributions will want to make Creator work with
their qbs package instead of adding it a second time
via the submodule, so we support that by checking for
the QBS_INSTALL_DIR environment variable.
This supersedes the current mechanism using QBS_SOURCE_DIR
and QBS_BUILD_DIR.

Change-Id: I2cff651cd23ea47b1a1434e33f80cb74ca0fc96b
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Christian Kandeler
2013-09-06 14:39:11 +02:00
parent a8d7e15a5d
commit 3e6fcd6063
6 changed files with 34 additions and 31 deletions

View File

@@ -423,9 +423,9 @@ void QbsProject::parse(const QVariantMap &config, const Environment &env, const
params.setIgnoreDifferentProjectFilePath(false);
params.setEnvironment(env.toProcessEnvironment());
qbs::Preferences *prefs = QbsManager::preferences();
const QString buildDir = qbsBuildDir();
params.setSearchPaths(prefs->searchPaths(buildDir));
params.setPluginPaths(prefs->pluginPaths(buildDir));
const QString qbsDir = qbsDirectory();
params.setSearchPaths(prefs->searchPaths(qbsDir));
params.setPluginPaths(prefs->pluginPaths(qbsDir));
// Do the parsing:
prepareForParsing();
@@ -658,12 +658,12 @@ void QbsProject::updateDeploymentInfo(const qbs::Project *project)
activeTarget()->setDeploymentData(deploymentData);
}
QString QbsProject::qbsBuildDir() const
QString QbsProject::qbsDirectory() const
{
QString buildDir = Environment::systemEnvironment().value(QLatin1String("QBS_BUILD_DIR"));
if (buildDir.isEmpty())
buildDir = ICore::resourcePath() + QLatin1String("/qbs");
return buildDir;
const QString qbsInstallDir = QLatin1String(QBS_INSTALL_DIR);
if (!qbsInstallDir.isEmpty())
return qbsInstallDir;
return ICore::resourcePath() + QLatin1String("/qbs");
}
} // namespace Internal