diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index acdd2fdf8251c25e2d3a5921de1ad6f09763571a..b67e2303cdca8b98f2a0ebb5ba18f26d336f4e6c 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -161,6 +161,7 @@ bool debug = false; static const char kCurrentProjectPath[] = "CurrentProject:Path"; static const char kCurrentProjectFilePath[] = "CurrentProject:FilePath"; +static const char kCurrentProjectBuildPath[] = "CurrentProject:BuildPath"; namespace ProjectExplorer { @@ -1028,6 +1029,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er tr("Full path of the current project's main file, including file name.")); vm->registerVariable(kCurrentProjectPath, tr("Full path of the current project's main file, excluding file name.")); + vm->registerVariable(kCurrentProjectBuildPath, + tr("Full build path of the current project's active build configuration.")); connect(vm, SIGNAL(variableUpdateRequested(QByteArray)), this, SLOT(updateVariable(QByteArray))); @@ -1165,6 +1168,13 @@ void ProjectExplorerPlugin::updateVariable(const QByteArray &variable) } else { Core::VariableManager::instance()->remove(variable); } + } else if (variable == kCurrentProjectBuildPath) { + if (currentProject() && currentProject()->activeTarget() && currentProject()->activeTarget()->activeBuildConfiguration()) { + Core::VariableManager::instance()->insert(variable, + currentProject()->activeTarget()->activeBuildConfiguration()->buildDirectory()); + } else { + Core::VariableManager::instance()->remove(variable); + } } }