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);
}
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:
// --------------------------------------------------------------------