Files
qt-creator/src/plugins/autotoolsprojectmanager/autotoolsprojectplugin.cpp
Christian Kandeler 01cc0e7499 Autotools: Make the BuildSystem per BuildConfiguration
The per-target variant is intended for project managers without build
configurations.

Fixes: QTCREATORBUG-32064
Change-Id: I908627dbe11a68ee7ac4cca3a10f956630008f08
Reviewed-by: hjk <hjk@qt.io>
2024-11-26 17:04:40 +00:00

92 lines
2.9 KiB
C++

// Copyright (C) 2016 Openismus GmbH.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "autogenstep.h"
#include "autoreconfstep.h"
#include "autotoolsbuildconfiguration.h"
#include "autotoolsprojectconstants.h"
#include "configurestep.h"
#include "makestep.h"
#include <coreplugin/icontext.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectmanager.h>
#include <extensionsystem/iplugin.h>
#include <utils/mimeconstants.h>
using namespace ProjectExplorer;
namespace AutotoolsProjectManager::Internal {
/**
* @brief Implementation of the ProjectExplorer::Project interface.
*
* Loads the autotools project and embeds it into the QtCreator project tree.
* The class AutotoolsProject is the core of the autotools project plugin.
* It is responsible to parse the Makefile.am files and do trigger project
* updates if a Makefile.am file or a configure.ac file has been changed.
*/
class AutotoolsProject : public Project
{
public:
explicit AutotoolsProject(const Utils::FilePath &fileName)
: Project(Utils::Constants::MAKEFILE_MIMETYPE, fileName)
{
setId(Constants::AUTOTOOLS_PROJECT_ID);
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
setDisplayName(projectDirectory().fileName());
setHasMakeInstallEquivalent(true);
}
};
/**
* @brief Implementation of the ExtensionsSystem::IPlugin interface.
*
* The plugin creates the following components:
*
* - AutotoolsManager: Will manage the new autotools project and
* tell QtCreator for which MIME types the autotools project should
* be instantiated.
*
* - MakeStepFactory: This factory is used to create make steps.
*
* - AutogenStepFactory: This factory is used to create autogen steps.
*
* - AutoreconfStepFactory: This factory is used to create autoreconf
* steps.
*
* - ConfigureStepFactory: This factory is used to create configure steps.
*
* - MakefileEditorFactory: Provides a specialized editor with automatic
* syntax highlighting for Makefile.am files.
*
* - AutotoolsBuildConfigurationFactory: Creates build configurations that
* contain the steps (make, autogen, autoreconf or configure) that will
* be executed in the build process)
*/
class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutotoolsProjectManager.json")
void initialize() final
{
ProjectManager::registerProjectType<AutotoolsProject>(Utils::Constants::MAKEFILE_MIMETYPE);
setupAutogenStep();
setupConfigureStep();
setupAutoreconfStep();
setupAutotoolsMakeStep();
setupAutotoolsBuildConfiguration();
}
};
} // AutotoolsProjectManager::Internal
#include "autotoolsprojectplugin.moc"