forked from qt-creator/qt-creator
CMake: Hide CMakeManager implementation in .cpp
Change-Id: Ia66d73cd060d17c2d25a1d5b89155ab4e7a6b62b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/kitaspects.h>
|
#include <projectexplorer/kitaspects.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectexplorericons.h>
|
#include <projectexplorer/projectexplorericons.h>
|
||||||
@@ -48,6 +49,36 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace CMakeProjectManager::Internal {
|
namespace CMakeProjectManager::Internal {
|
||||||
|
|
||||||
|
class CMakeManager final : public QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CMakeManager();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateCmakeActions(Node *node);
|
||||||
|
void clearCMakeCache(BuildSystem *buildSystem);
|
||||||
|
void runCMake(BuildSystem *buildSystem);
|
||||||
|
void runCMakeWithProfiling(BuildSystem *buildSystem);
|
||||||
|
void rescanProject(BuildSystem *buildSystem);
|
||||||
|
void buildFileContextMenu();
|
||||||
|
void buildFile(Node *node = nullptr);
|
||||||
|
void updateBuildFileAction();
|
||||||
|
void enableBuildFileMenus(Node *node);
|
||||||
|
void reloadCMakePresets();
|
||||||
|
|
||||||
|
QAction *m_runCMakeAction;
|
||||||
|
QAction *m_clearCMakeCacheAction;
|
||||||
|
QAction *m_runCMakeActionContextMenu;
|
||||||
|
QAction *m_rescanProjectAction;
|
||||||
|
QAction *m_buildFileContextMenu;
|
||||||
|
QAction *m_reloadCMakePresetsAction;
|
||||||
|
Utils::ParameterAction *m_buildFileAction;
|
||||||
|
QAction *m_cmakeProfilerAction;
|
||||||
|
QAction *m_cmakeDebuggerAction;
|
||||||
|
QAction *m_cmakeDebuggerSeparator;
|
||||||
|
bool m_canDebugCMake = false;
|
||||||
|
};
|
||||||
|
|
||||||
CMakeManager::CMakeManager()
|
CMakeManager::CMakeManager()
|
||||||
{
|
{
|
||||||
namespace PEC = ProjectExplorer::Constants;
|
namespace PEC = ProjectExplorer::Constants;
|
||||||
@@ -411,4 +442,9 @@ void CMakeManager::buildFileContextMenu()
|
|||||||
buildFile(node);
|
buildFile(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupCMakeManager()
|
||||||
|
{
|
||||||
|
static CMakeManager theCMakeManager;
|
||||||
|
}
|
||||||
|
|
||||||
} // CMakeProjectManager::Internal
|
} // CMakeProjectManager::Internal
|
||||||
|
|||||||
@@ -3,48 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
namespace CMakeProjectManager::Internal {
|
||||||
|
|
||||||
namespace Utils { class ParameterAction; }
|
void setupCMakeManager();
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
} // CMakeProjectManager::Internal
|
||||||
class QAction;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace CMakeProjectManager {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class CMakeManager : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
CMakeManager();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateCmakeActions(ProjectExplorer::Node *node);
|
|
||||||
void clearCMakeCache(ProjectExplorer::BuildSystem *buildSystem);
|
|
||||||
void runCMake(ProjectExplorer::BuildSystem *buildSystem);
|
|
||||||
void runCMakeWithProfiling(ProjectExplorer::BuildSystem *buildSystem);
|
|
||||||
void rescanProject(ProjectExplorer::BuildSystem *buildSystem);
|
|
||||||
void buildFileContextMenu();
|
|
||||||
void buildFile(ProjectExplorer::Node *node = nullptr);
|
|
||||||
void updateBuildFileAction();
|
|
||||||
void enableBuildFileMenus(ProjectExplorer::Node *node);
|
|
||||||
void reloadCMakePresets();
|
|
||||||
|
|
||||||
QAction *m_runCMakeAction;
|
|
||||||
QAction *m_clearCMakeCacheAction;
|
|
||||||
QAction *m_runCMakeActionContextMenu;
|
|
||||||
QAction *m_rescanProjectAction;
|
|
||||||
QAction *m_buildFileContextMenu;
|
|
||||||
QAction *m_reloadCMakePresetsAction;
|
|
||||||
Utils::ParameterAction *m_buildFileAction;
|
|
||||||
QAction *m_cmakeProfilerAction;
|
|
||||||
QAction *m_cmakeDebuggerAction;
|
|
||||||
QAction *m_cmakeDebuggerSeparator;
|
|
||||||
bool m_canDebugCMake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace CMakeProjectManager
|
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ public:
|
|||||||
|
|
||||||
CMakeSettingsPage settingsPage;
|
CMakeSettingsPage settingsPage;
|
||||||
|
|
||||||
CMakeManager manager;
|
|
||||||
CMakeBuildStepFactory buildStepFactory;
|
CMakeBuildStepFactory buildStepFactory;
|
||||||
CMakeBuildConfigurationFactory buildConfigFactory;
|
CMakeBuildConfigurationFactory buildConfigFactory;
|
||||||
CMakeEditorFactory editorFactor;
|
CMakeEditorFactory editorFactor;
|
||||||
@@ -82,6 +81,8 @@ class CMakeProjectPlugin final : public ExtensionSystem::IPlugin
|
|||||||
{
|
{
|
||||||
d = new CMakeProjectPluginPrivate;
|
d = new CMakeProjectPluginPrivate;
|
||||||
|
|
||||||
|
setupCMakeManager();
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
addTestCreator(createCMakeConfigTest);
|
addTestCreator(createCMakeConfigTest);
|
||||||
addTestCreator(createCMakeParserTest);
|
addTestCreator(createCMakeParserTest);
|
||||||
|
|||||||
Reference in New Issue
Block a user