Provide %{buildDir} macro expansion again.

This was a regression introduced during the macro expander rework.

Task-number: QTCREATORBUG-13260
Change-Id: I9fd28c6a522faa11992931f937dd0b0eb779f419
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
hjk
2014-11-05 14:01:26 +01:00
parent 7d417271c3
commit f406a38ca7
5 changed files with 30 additions and 23 deletions

View File

@@ -138,6 +138,29 @@ Target::Target(Project *project, Kit *k) :
this, SLOT(handleKitUpdates(ProjectExplorer::Kit*)));
connect(km, SIGNAL(kitRemoved(ProjectExplorer::Kit*)),
this, SLOT(handleKitRemoval(ProjectExplorer::Kit*)));
Utils::MacroExpander *expander = macroExpander();
expander->registerSubProvider([this] { return kit()->macroExpander(); });
// Legacy support.
expander->registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
QCoreApplication::translate("ProjectExplorer", "Name of current project"),
[project] { return project->displayName(); },
false);
expander->registerVariable(Constants::VAR_CURRENTBUILD_NAME,
QCoreApplication::translate("ProjectExplorer", "Name of current build"),
[this] { return activeBuildConfiguration() ? activeBuildConfiguration()->displayName() : QString(); },
false);
expander->registerVariable("sourceDir", tr("Source directory"),
[project] { return project->projectDirectory().toUserOutput(); });
expander->registerVariable("buildDir", tr("Build directory"),
[this] { return activeBuildConfiguration()
? activeBuildConfiguration()->buildDirectory().toUserOutput()
: QString() ; });
}
Target::~Target()