2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Openismus GmbH.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-11-29 14:19:28 +01:00
|
|
|
|
|
|
|
#include "autogenstep.h"
|
|
|
|
#include "autoreconfstep.h"
|
2019-08-13 12:47:11 +02:00
|
|
|
#include "autotoolsbuildconfiguration.h"
|
|
|
|
#include "autotoolsprojectconstants.h"
|
2011-11-29 14:19:28 +01:00
|
|
|
#include "configurestep.h"
|
2019-08-13 12:47:11 +02:00
|
|
|
#include "makestep.h"
|
2017-03-03 18:16:34 +01:00
|
|
|
|
2019-08-13 12:47:11 +02:00
|
|
|
#include <coreplugin/icontext.h>
|
2019-10-25 09:55:32 +02:00
|
|
|
|
2020-01-09 14:00:22 +01:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2022-09-29 17:11:01 +02:00
|
|
|
#include <projectexplorer/project.h>
|
2017-03-03 18:16:34 +01:00
|
|
|
#include <projectexplorer/projectmanager.h>
|
2011-11-29 14:19:28 +01:00
|
|
|
|
2023-07-05 12:20:59 +02:00
|
|
|
#include <extensionsystem/iplugin.h>
|
|
|
|
|
2023-10-19 17:17:37 +02:00
|
|
|
#include <utils/mimeconstants.h>
|
|
|
|
|
2023-07-05 12:20:59 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
2022-09-29 17:11:01 +02:00
|
|
|
namespace AutotoolsProjectManager::Internal {
|
2011-11-29 14:19:28 +01:00
|
|
|
|
2022-09-29 17:11:01 +02:00
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
2023-07-05 12:20:59 +02:00
|
|
|
class AutotoolsProject : public Project
|
2019-08-13 12:47:11 +02:00
|
|
|
{
|
2022-09-29 17:11:01 +02:00
|
|
|
public:
|
|
|
|
explicit AutotoolsProject(const Utils::FilePath &fileName)
|
2023-10-19 17:17:37 +02:00
|
|
|
: Project(Utils::Constants::MAKEFILE_MIMETYPE, fileName)
|
2022-09-29 17:11:01 +02:00
|
|
|
{
|
|
|
|
setId(Constants::AUTOTOOLS_PROJECT_ID);
|
|
|
|
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
|
|
|
setDisplayName(projectDirectory().fileName());
|
|
|
|
setHasMakeInstallEquivalent(true);
|
|
|
|
}
|
|
|
|
};
|
2019-08-13 12:47:11 +02:00
|
|
|
|
2023-07-05 12:20:59 +02:00
|
|
|
/**
|
|
|
|
* @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)
|
|
|
|
*/
|
2019-08-13 12:47:11 +02:00
|
|
|
|
2023-07-05 12:20:59 +02:00
|
|
|
class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin
|
2018-01-26 15:38:21 +01:00
|
|
|
{
|
2023-07-05 12:20:59 +02:00
|
|
|
Q_OBJECT
|
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutotoolsProjectManager.json")
|
2011-11-29 14:19:28 +01:00
|
|
|
|
2023-07-05 12:20:59 +02:00
|
|
|
void initialize() final
|
|
|
|
{
|
2024-01-30 09:00:47 +01:00
|
|
|
ProjectManager::registerProjectType<AutotoolsProject>(Utils::Constants::MAKEFILE_MIMETYPE);
|
2023-08-30 17:09:09 +02:00
|
|
|
|
2024-07-19 14:16:08 +02:00
|
|
|
setupAutogenStep();
|
|
|
|
setupConfigureStep();
|
|
|
|
setupAutoreconfStep();
|
|
|
|
setupAutotoolsMakeStep();
|
|
|
|
setupAutotoolsBuildConfiguration();
|
|
|
|
}
|
2023-07-05 12:20:59 +02:00
|
|
|
};
|
2018-01-26 15:38:21 +01:00
|
|
|
|
2022-09-29 17:11:01 +02:00
|
|
|
} // AutotoolsProjectManager::Internal
|
2023-07-05 12:20:59 +02:00
|
|
|
|
|
|
|
#include "autotoolsprojectplugin.moc"
|