CMakeKitInformation: Expose cmake path to MacroExpander

Task-number: QTCREATORBUG-15367
Change-Id: Ia685b738c242b77eef2a96932dee1f7ebfe1787e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-11-23 12:45:47 +01:00
parent 49735ee5ee
commit 79c710463e
2 changed files with 11 additions and 0 deletions

View File

@@ -126,6 +126,15 @@ KitConfigWidget *CMakeKitInformation::createConfigWidget(Kit *k) const
return new Internal::CMakeKitConfigWidget(k, this); return new Internal::CMakeKitConfigWidget(k, this);
} }
void CMakeKitInformation::addToMacroExpander(Kit *k, Utils::MacroExpander *expander) const
{
expander->registerFileVariables("CMake:Executable", tr("Path to the cmake executable"),
[k]() -> QString {
CMakeTool *tool = CMakeKitInformation::cmakeTool(k);
return tool ? tool->cmakeExecutable().toString() : QString();
});
}
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// CMakeGeneratorKitInformation: // CMakeGeneratorKitInformation:
// -------------------------------------------------------------------- // --------------------------------------------------------------------

View File

@@ -51,6 +51,8 @@ public:
void fix(ProjectExplorer::Kit *k) override; void fix(ProjectExplorer::Kit *k) override;
ItemList toUserOutput(const ProjectExplorer::Kit *k) const override; ItemList toUserOutput(const ProjectExplorer::Kit *k) const override;
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const override; ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const override;
}; };
class CMAKE_EXPORT CMakeGeneratorKitInformation : public ProjectExplorer::KitInformation class CMAKE_EXPORT CMakeGeneratorKitInformation : public ProjectExplorer::KitInformation