diff options
author | Benjamin Zeller <benjamin.zeller@canonical.com> | 2015-02-04 17:54:46 +0100 |
---|---|---|
committer | Benjamin Zeller <benjamin.zeller@canonical.com> | 2015-02-24 09:54:43 +0000 |
commit | 99e9643dea3871f26c5a09e4a1715ba84c9103e9 (patch) | |
tree | bc9045a5081cb8d6b4886fae2f4fa353a771d8e7 /src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | |
parent | f4a3b4ca5fa312df82f0067e9139fc18bc4fd57f (diff) | |
download | qt-creator-99e9643dea3871f26c5a09e4a1715ba84c9103e9.tar.gz |
Make it possible to register multiple cmake instances
This patch add the CMakeToolManager, a central repository for cmake instances.
One instance is always the currently used "default". By that its possible to
switch between different cmake installations. The next step will be adding
it to the Kits.
Change-Id: I310fdd805e0ed239077a5632303e891dbd1d9ea1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 2f5c271499..c319321c7b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -33,6 +33,7 @@ #include "cmakeprojectconstants.h" #include "cmakeproject.h" #include "cmakesettingspage.h" +#include "cmaketoolmanager.h" #include <utils/synchronousprocess.h> @@ -47,8 +48,7 @@ using namespace CMakeProjectManager::Internal; -CMakeManager::CMakeManager(CMakeSettingsPage *cmakeSettingsPage) - : m_settingsPage(cmakeSettingsPage) +CMakeManager::CMakeManager() { ProjectExplorer::ProjectTree *tree = ProjectExplorer::ProjectTree::instance(); connect(tree, &ProjectExplorer::ProjectTree::aboutToShowContextMenu, @@ -130,32 +130,39 @@ QString CMakeManager::mimeType() const QString CMakeManager::cmakeExecutable() const { - return m_settingsPage->cmakeExecutable(); + CMakeTool *cmake = CMakeToolManager::defaultCMakeTool(); + if (cmake) + return cmake->cmakeExecutable().toString(); + return QString(); } bool CMakeManager::isCMakeExecutableValid() const { - return m_settingsPage->isCMakeExecutableValid(); -} - -void CMakeManager::setCMakeExecutable(const QString &executable) -{ - m_settingsPage->setCMakeExecutable(executable); + CMakeTool *cmake = CMakeToolManager::defaultCMakeTool(); + if (cmake) + return cmake->isValid(); + return false; } bool CMakeManager::hasCodeBlocksMsvcGenerator() const { - return m_settingsPage->hasCodeBlocksMsvcGenerator(); + CMakeTool *cmake = CMakeToolManager::defaultCMakeTool(); + if (cmake) + return cmake->hasCodeBlocksMsvcGenerator(); + return false; } bool CMakeManager::hasCodeBlocksNinjaGenerator() const { - return m_settingsPage->hasCodeBlocksNinjaGenerator(); + CMakeTool *cmake = CMakeToolManager::defaultCMakeTool(); + if (cmake) + return cmake->hasCodeBlocksNinjaGenerator(); + return false; } bool CMakeManager::preferNinja() const { - return m_settingsPage->preferNinja(); + return CMakeToolManager::preferNinja(); } // need to refactor this out |