summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-11-23 12:45:47 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2016-03-18 14:23:10 +0000
commit79c710463e9249762dcdf3d1badcfaa1beecd132 (patch)
tree22d3ab352414be50f87624192be3906ef983097b
parent49735ee5ee4491668e66f7c35db71dd1f998d988 (diff)
downloadqt-creator-79c710463e9249762dcdf3d1badcfaa1beecd132.tar.gz
CMakeKitInformation: Expose cmake path to MacroExpander
Task-number: QTCREATORBUG-15367 Change-Id: Ia685b738c242b77eef2a96932dee1f7ebfe1787e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
-rw-r--r--src/plugins/cmakeprojectmanager/cmakekitinformation.cpp9
-rw-r--r--src/plugins/cmakeprojectmanager/cmakekitinformation.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
index 7ae8379c4f..baada0b59a 100644
--- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
@@ -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:
// --------------------------------------------------------------------
diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h
index 9a008d134f..591e915fe3 100644
--- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h
+++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h
@@ -51,6 +51,8 @@ public:
void fix(ProjectExplorer::Kit *k) override;
ItemList toUserOutput(const 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