ProjectExplorer: Add CurrentBuild:Env to the MacroExpander

Make BuildConfigurations provide %{CurrentBuild:Env:VARNAME} via the
macro expander infrastructure.

Change-Id: I1bed8c6aa9003c361a07fa69a5a3840f7a4e0d17
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-01-25 16:15:54 +01:00
parent fcc9ccaf6e
commit 4672624bdc
2 changed files with 6 additions and 2 deletions

View File

@@ -104,9 +104,12 @@ void BuildConfiguration::ctor()
expander->registerVariable("buildDir", tr("Build directory"),
[this] { return buildDirectory().toUserOutput(); });
expander->registerVariable(Constants::VAR_CURRENTBUILD_NAME,
QCoreApplication::translate("ProjectExplorer", "Name of current build"),
expander->registerVariable(Constants::VAR_CURRENTBUILD_NAME, tr("Name of current build"),
[this] { return displayName(); }, false);
expander->registerPrefix(Constants::VAR_CURRENTBUILD_ENV,
tr("Variables in the current build environment"),
[this](const QString &var) { return environment().value(var); });
}
Utils::FileName BuildConfiguration::buildDirectory() const