forked from qt-creator/qt-creator
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:
@@ -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:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user