forked from qt-creator/qt-creator
Autotools: Introduce AutotoolsBuildSystem
Introduce AutotoolsBuildSystem and slim down AutotoolsProject. Change-Id: I68296152f9ecd5d14198c8d0b36a06c2d1b162ec Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -4,8 +4,8 @@ add_qtc_plugin(AutotoolsProjectManager
|
|||||||
autogenstep.cpp autogenstep.h
|
autogenstep.cpp autogenstep.h
|
||||||
autoreconfstep.cpp autoreconfstep.h
|
autoreconfstep.cpp autoreconfstep.h
|
||||||
autotoolsbuildconfiguration.cpp autotoolsbuildconfiguration.h
|
autotoolsbuildconfiguration.cpp autotoolsbuildconfiguration.h
|
||||||
|
autotoolsbuildsystem.cpp autotoolsbuildsystem.h
|
||||||
autotoolsopenprojectwizard.cpp autotoolsopenprojectwizard.h
|
autotoolsopenprojectwizard.cpp autotoolsopenprojectwizard.h
|
||||||
autotoolsproject.cpp autotoolsproject.h
|
|
||||||
autotoolsprojectconstants.h
|
autotoolsprojectconstants.h
|
||||||
autotoolsprojectplugin.cpp autotoolsprojectplugin.h
|
autotoolsprojectplugin.cpp autotoolsprojectplugin.h
|
||||||
configurestep.cpp configurestep.h
|
configurestep.cpp configurestep.h
|
||||||
|
@@ -26,14 +26,12 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "autogenstep.h"
|
#include "autogenstep.h"
|
||||||
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
#include <projectexplorer/processparameters.h>
|
#include <projectexplorer/processparameters.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -43,7 +41,6 @@ using namespace AutotoolsProjectManager::Internal;
|
|||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
|
|
||||||
// AutogenStepFactory
|
// AutogenStepFactory
|
||||||
|
|
||||||
AutogenStepFactory::AutogenStepFactory()
|
AutogenStepFactory::AutogenStepFactory()
|
||||||
|
@@ -26,14 +26,12 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "autoreconfstep.h"
|
#include "autoreconfstep.h"
|
||||||
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
#include <projectexplorer/processparameters.h>
|
#include <projectexplorer/processparameters.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
using namespace AutotoolsProjectManager;
|
using namespace AutotoolsProjectManager;
|
||||||
|
@@ -27,18 +27,13 @@
|
|||||||
|
|
||||||
#include "autotoolsbuildconfiguration.h"
|
#include "autotoolsbuildconfiguration.h"
|
||||||
|
|
||||||
#include "autotoolsproject.h"
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <projectexplorer/buildinfo.h>
|
#include <projectexplorer/buildinfo.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
|
|
||||||
using namespace AutotoolsProjectManager::Constants;
|
using namespace AutotoolsProjectManager::Constants;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
@@ -25,67 +25,36 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "autotoolsproject.h"
|
#include "autotoolsbuildsystem.h"
|
||||||
#include "autotoolsbuildconfiguration.h"
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "makefileparserthread.h"
|
||||||
#include "autotoolsopenprojectwizard.h"
|
#include "makestep.h"
|
||||||
#include "makestep.h"
|
|
||||||
#include "makefileparserthread.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/abi.h>
|
|
||||||
#include <projectexplorer/toolchain.h>
|
|
||||||
#include <projectexplorer/kitinformation.h>
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
|
||||||
#include <projectexplorer/projectnodes.h>
|
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
#include <projectexplorer/headerpath.h>
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
#include <cpptools/cppmodelmanager.h>
|
|
||||||
#include <cpptools/projectinfo.h>
|
|
||||||
#include <cpptools/cppprojectupdater.h>
|
#include <cpptools/cppprojectupdater.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
|
||||||
#include <qtsupport/qtcppkitinfo.h>
|
#include <qtsupport/qtcppkitinfo.h>
|
||||||
#include <qtsupport/qtkitinformation.h>
|
|
||||||
#include <utils/algorithm.h>
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
#include <utils/filesystemwatcher.h>
|
#include <utils/filesystemwatcher.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QTimer>
|
|
||||||
#include <QPointer>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QCursor>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
|
|
||||||
using namespace AutotoolsProjectManager;
|
|
||||||
using namespace AutotoolsProjectManager::Internal;
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
AutotoolsProject::AutotoolsProject(const Utils::FilePath &fileName)
|
namespace AutotoolsProjectManager {
|
||||||
: Project(Constants::MAKEFILE_MIMETYPE, fileName)
|
namespace Internal {
|
||||||
|
|
||||||
|
AutotoolsBuildSystem::AutotoolsBuildSystem(Project *project)
|
||||||
|
: BuildSystem(project)
|
||||||
, m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
|
, m_cppCodeModelUpdater(new CppTools::CppProjectUpdater)
|
||||||
{
|
{
|
||||||
setId(Constants::AUTOTOOLS_PROJECT_ID);
|
connect(project, &Project::activeBuildConfigurationChanged, this, [this]() { requestParse(); });
|
||||||
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
|
||||||
setDisplayName(projectDirectory().fileName());
|
|
||||||
|
|
||||||
setHasMakeInstallEquivalent(true);
|
connect(project, &Project::projectFileIsDirty, this, [this]() { requestParse(); });
|
||||||
|
|
||||||
connect(this, &AutotoolsProject::projectFileIsDirty, this, &AutotoolsProject::loadProjectTree);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AutotoolsProject::~AutotoolsProject()
|
AutotoolsBuildSystem::~AutotoolsBuildSystem()
|
||||||
{
|
{
|
||||||
delete m_cppCodeModelUpdater;
|
delete m_cppCodeModelUpdater;
|
||||||
|
|
||||||
setRootProjectNode(nullptr);
|
|
||||||
|
|
||||||
if (m_makefileParserThread) {
|
if (m_makefileParserThread) {
|
||||||
m_makefileParserThread->wait();
|
m_makefileParserThread->wait();
|
||||||
delete m_makefileParserThread;
|
delete m_makefileParserThread;
|
||||||
@@ -93,65 +62,42 @@ AutotoolsProject::~AutotoolsProject()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function, is called at the very beginning, to
|
void AutotoolsBuildSystem::parseProject(BuildSystem::ParsingContext &&ctx)
|
||||||
// restore the settings if there are some stored.
|
|
||||||
Project::RestoreResult AutotoolsProject::fromMap(const QVariantMap &map, QString *errorMessage)
|
|
||||||
{
|
|
||||||
RestoreResult result = Project::fromMap(map, errorMessage);
|
|
||||||
if (result != RestoreResult::Ok)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
// Load the project tree structure.
|
|
||||||
loadProjectTree();
|
|
||||||
|
|
||||||
if (!activeTarget())
|
|
||||||
addTargetForDefaultKit();
|
|
||||||
|
|
||||||
return RestoreResult::Ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AutotoolsProject::loadProjectTree()
|
|
||||||
{
|
{
|
||||||
if (m_makefileParserThread) {
|
if (m_makefileParserThread) {
|
||||||
// The thread is still busy parsing a previus configuration.
|
// The thread is still busy parsing a previous configuration.
|
||||||
// Wait until the thread has been finished and delete it.
|
// Wait until the thread has been finished and delete it.
|
||||||
// TODO: Discuss whether blocking is acceptable.
|
// TODO: Discuss whether blocking is acceptable.
|
||||||
disconnect(m_makefileParserThread, &QThread::finished,
|
disconnect(m_makefileParserThread,
|
||||||
this, &AutotoolsProject::makefileParsingFinished);
|
&QThread::finished,
|
||||||
|
this,
|
||||||
|
&AutotoolsBuildSystem::makefileParsingFinished);
|
||||||
m_makefileParserThread->wait();
|
m_makefileParserThread->wait();
|
||||||
delete m_makefileParserThread;
|
delete m_makefileParserThread;
|
||||||
m_makefileParserThread = nullptr;
|
m_makefileParserThread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the makefile asynchronously in a thread
|
// Parse the makefile asynchronously in a thread
|
||||||
m_makefileParserThread = new MakefileParserThread(projectFilePath().toString(),
|
m_makefileParserThread = new MakefileParserThread(project()->projectFilePath().toString(),
|
||||||
guardParsingRun());
|
std::move(ctx.guard));
|
||||||
|
|
||||||
connect(m_makefileParserThread, &MakefileParserThread::started,
|
connect(m_makefileParserThread,
|
||||||
this, &AutotoolsProject::makefileParsingStarted);
|
&MakefileParserThread::finished,
|
||||||
|
this,
|
||||||
connect(m_makefileParserThread, &MakefileParserThread::finished,
|
&AutotoolsBuildSystem::makefileParsingFinished);
|
||||||
this, &AutotoolsProject::makefileParsingFinished);
|
|
||||||
m_makefileParserThread->start();
|
m_makefileParserThread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutotoolsProject::makefileParsingStarted()
|
void AutotoolsBuildSystem::makefileParsingFinished()
|
||||||
{
|
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
|
||||||
}
|
|
||||||
|
|
||||||
void AutotoolsProject::makefileParsingFinished()
|
|
||||||
{
|
{
|
||||||
// The finished() signal is from a previous makefile-parser-thread
|
// The finished() signal is from a previous makefile-parser-thread
|
||||||
// and can be skipped. This can happen, if the thread has emitted the
|
// and can be skipped. This can happen, if the thread has emitted the
|
||||||
// finished() signal during the execution of AutotoolsProject::loadProjectTree().
|
// finished() signal during the execution of AutotoolsBuildSystem::loadProjectTree().
|
||||||
// In this case the signal is in the message queue already and deleting
|
// In this case the signal is in the message queue already and deleting
|
||||||
// the thread of course does not remove the signal again.
|
// the thread of course does not remove the signal again.
|
||||||
if (sender() != m_makefileParserThread)
|
if (sender() != m_makefileParserThread)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
|
|
||||||
if (m_makefileParserThread->isCanceled()) {
|
if (m_makefileParserThread->isCanceled()) {
|
||||||
// The parsing has been cancelled by the user. Don't show any
|
// The parsing has been cancelled by the user. Don't show any
|
||||||
// project data at all.
|
// project data at all.
|
||||||
@@ -167,8 +113,8 @@ void AutotoolsProject::makefileParsingFinished()
|
|||||||
|
|
||||||
QVector<Utils::FilePath> filesToWatch;
|
QVector<Utils::FilePath> filesToWatch;
|
||||||
|
|
||||||
// Apply sources to m_files, which are returned at AutotoolsProject::files()
|
// Apply sources to m_files, which are returned at AutotoolsBuildSystem::files()
|
||||||
const QFileInfo fileInfo = projectFilePath().toFileInfo();
|
const QFileInfo fileInfo = project()->projectFilePath().toFileInfo();
|
||||||
const QDir dir = fileInfo.absoluteDir();
|
const QDir dir = fileInfo.absoluteDir();
|
||||||
const QStringList files = m_makefileParserThread->sources();
|
const QStringList files = m_makefileParserThread->sources();
|
||||||
foreach (const QString& file, files)
|
foreach (const QString& file, files)
|
||||||
@@ -195,14 +141,14 @@ void AutotoolsProject::makefileParsingFinished()
|
|||||||
filesToWatch.append(Utils::FilePath::fromString(absConfigureAc));
|
filesToWatch.append(Utils::FilePath::fromString(absConfigureAc));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newRoot = std::make_unique<ProjectNode>(projectDirectory());
|
auto newRoot = std::make_unique<ProjectNode>(project()->projectDirectory());
|
||||||
for (const QString &f : m_files) {
|
for (const QString &f : m_files) {
|
||||||
const Utils::FilePath path = Utils::FilePath::fromString(f);
|
const Utils::FilePath path = Utils::FilePath::fromString(f);
|
||||||
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
newRoot->addNestedNode(std::make_unique<FileNode>(path,
|
||||||
FileNode::fileTypeForFileName(path)));
|
FileNode::fileTypeForFileName(path)));
|
||||||
}
|
}
|
||||||
setRootProjectNode(std::move(newRoot));
|
project()->setRootProjectNode(std::move(newRoot));
|
||||||
setExtraProjectFiles(filesToWatch);
|
project()->setExtraProjectFiles(filesToWatch);
|
||||||
|
|
||||||
updateCppCodeModel();
|
updateCppCodeModel();
|
||||||
|
|
||||||
@@ -228,14 +174,16 @@ static QStringList filterIncludes(const QString &absSrc, const QString &absBuild
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutotoolsProject::updateCppCodeModel()
|
void AutotoolsBuildSystem::updateCppCodeModel()
|
||||||
{
|
{
|
||||||
QtSupport::CppKitInfo kitInfo(this);
|
QtSupport::CppKitInfo kitInfo(project());
|
||||||
QTC_ASSERT(kitInfo.isValid(), return );
|
QTC_ASSERT(kitInfo.isValid(), return );
|
||||||
|
|
||||||
|
const Utils::FilePath projectFilePath = project()->projectFilePath();
|
||||||
|
|
||||||
CppTools::RawProjectPart rpp;
|
CppTools::RawProjectPart rpp;
|
||||||
rpp.setDisplayName(displayName());
|
rpp.setDisplayName(project()->displayName());
|
||||||
rpp.setProjectFileLocation(projectFilePath().toString());
|
rpp.setProjectFileLocation(projectFilePath.toString());
|
||||||
rpp.setQtVersion(kitInfo.projectPartQtVersion);
|
rpp.setQtVersion(kitInfo.projectPartQtVersion);
|
||||||
const QStringList cflags = m_makefileParserThread->cflags();
|
const QStringList cflags = m_makefileParserThread->cflags();
|
||||||
QStringList cxxflags = m_makefileParserThread->cxxflags();
|
QStringList cxxflags = m_makefileParserThread->cxxflags();
|
||||||
@@ -244,14 +192,18 @@ void AutotoolsProject::updateCppCodeModel()
|
|||||||
rpp.setFlagsForC({kitInfo.cToolChain, cflags});
|
rpp.setFlagsForC({kitInfo.cToolChain, cflags});
|
||||||
rpp.setFlagsForCxx({kitInfo.cxxToolChain, cxxflags});
|
rpp.setFlagsForCxx({kitInfo.cxxToolChain, cxxflags});
|
||||||
|
|
||||||
const QString absSrc = projectDirectory().toString();
|
const QString absSrc = project()->projectDirectory().toString();
|
||||||
const Target *target = activeTarget();
|
const Target *target = project()->activeTarget();
|
||||||
const QString absBuild = (target && target->activeBuildConfiguration())
|
BuildConfiguration *bc = target ? target->activeBuildConfiguration() : nullptr;
|
||||||
? target->activeBuildConfiguration()->buildDirectory().toString() : QString();
|
|
||||||
|
const QString absBuild = bc ? bc->buildDirectory().toString() : QString();
|
||||||
|
|
||||||
rpp.setIncludePaths(filterIncludes(absSrc, absBuild, m_makefileParserThread->includePaths()));
|
rpp.setIncludePaths(filterIncludes(absSrc, absBuild, m_makefileParserThread->includePaths()));
|
||||||
rpp.setMacros(m_makefileParserThread->macros());
|
rpp.setMacros(m_makefileParserThread->macros());
|
||||||
rpp.setFiles(m_files);
|
rpp.setFiles(m_files);
|
||||||
|
|
||||||
m_cppCodeModelUpdater->update({this, kitInfo, activeParseEnvironment(), {rpp}});
|
m_cppCodeModelUpdater->update({project(), kitInfo, project()->activeParseEnvironment(), {rpp}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace AutotoolsProjectManager
|
@@ -27,50 +27,30 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
|
||||||
|
|
||||||
namespace Utils { class FileSystemWatcher; }
|
namespace Utils { class FileSystemWatcher; }
|
||||||
|
|
||||||
namespace CppTools { class CppProjectUpdater; }
|
namespace CppTools { class CppProjectUpdater; }
|
||||||
|
|
||||||
namespace AutotoolsProjectManager {
|
namespace AutotoolsProjectManager {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class MakefileParserThread;
|
class MakefileParserThread;
|
||||||
|
|
||||||
/**
|
class AutotoolsBuildSystem : public ProjectExplorer::BuildSystem
|
||||||
* @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 ProjectExplorer::Project
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AutotoolsProject(const Utils::FilePath &fileName);
|
explicit AutotoolsBuildSystem(ProjectExplorer::Project *project);
|
||||||
~AutotoolsProject() override;
|
~AutotoolsBuildSystem() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
void parseProject(ParsingContext &&ctx) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
|
||||||
* Loads the project tree by parsing the makefiles.
|
|
||||||
*/
|
|
||||||
void loadProjectTree();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is invoked when the makefile parsing by m_makefileParserThread has
|
|
||||||
* been started. Turns the mouse cursor into a busy cursor.
|
|
||||||
*/
|
|
||||||
void makefileParsingStarted();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is invoked when the makefile parsing by m_makefileParserThread has
|
* Is invoked when the makefile parsing by m_makefileParserThread has
|
||||||
* been finished. Adds all sources and files into the project tree and
|
* been finished. Adds all sources and files into the project tree and
|
@@ -29,10 +29,9 @@
|
|||||||
|
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
#include <QDir>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
using namespace AutotoolsProjectManager;
|
using namespace AutotoolsProjectManager;
|
||||||
using namespace AutotoolsProjectManager::Internal;
|
using namespace AutotoolsProjectManager::Internal;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
|
|
||||||
HEADERS = autotoolsprojectplugin.h\
|
HEADERS = autotoolsbuildsystem.h \
|
||||||
|
autotoolsprojectplugin.h\
|
||||||
autotoolsopenprojectwizard.h\
|
autotoolsopenprojectwizard.h\
|
||||||
autotoolsproject.h\
|
|
||||||
autotoolsbuildconfiguration.h\
|
autotoolsbuildconfiguration.h\
|
||||||
autotoolsprojectconstants.h\
|
autotoolsprojectconstants.h\
|
||||||
makestep.h\
|
makestep.h\
|
||||||
@@ -12,9 +12,9 @@ HEADERS = autotoolsprojectplugin.h\
|
|||||||
makefileparserthread.h\
|
makefileparserthread.h\
|
||||||
makefileparser.h
|
makefileparser.h
|
||||||
|
|
||||||
SOURCES = autotoolsprojectplugin.cpp\
|
SOURCES = autotoolsbuildsystem.cpp \
|
||||||
|
autotoolsprojectplugin.cpp\
|
||||||
autotoolsopenprojectwizard.cpp\
|
autotoolsopenprojectwizard.cpp\
|
||||||
autotoolsproject.cpp\
|
|
||||||
autotoolsbuildconfiguration.cpp\
|
autotoolsbuildconfiguration.cpp\
|
||||||
makestep.cpp\
|
makestep.cpp\
|
||||||
autogenstep.cpp\
|
autogenstep.cpp\
|
||||||
|
@@ -18,10 +18,10 @@ QtcPlugin {
|
|||||||
"autoreconfstep.h",
|
"autoreconfstep.h",
|
||||||
"autotoolsbuildconfiguration.cpp",
|
"autotoolsbuildconfiguration.cpp",
|
||||||
"autotoolsbuildconfiguration.h",
|
"autotoolsbuildconfiguration.h",
|
||||||
|
"autotoolsbuildsystem.cpp",
|
||||||
|
"autotoolsbuildsystem.h",
|
||||||
"autotoolsopenprojectwizard.cpp",
|
"autotoolsopenprojectwizard.cpp",
|
||||||
"autotoolsopenprojectwizard.h",
|
"autotoolsopenprojectwizard.h",
|
||||||
"autotoolsproject.cpp",
|
|
||||||
"autotoolsproject.h",
|
|
||||||
"autotoolsprojectconstants.h",
|
"autotoolsprojectconstants.h",
|
||||||
"autotoolsprojectplugin.cpp",
|
"autotoolsprojectplugin.cpp",
|
||||||
"autotoolsprojectplugin.h",
|
"autotoolsprojectplugin.h",
|
||||||
|
@@ -26,19 +26,33 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "autotoolsprojectplugin.h"
|
#include "autotoolsprojectplugin.h"
|
||||||
#include "autotoolsproject.h"
|
|
||||||
#include "autotoolsprojectconstants.h"
|
|
||||||
#include "autotoolsbuildconfiguration.h"
|
|
||||||
#include "makestep.h"
|
|
||||||
#include "autogenstep.h"
|
#include "autogenstep.h"
|
||||||
#include "autoreconfstep.h"
|
#include "autoreconfstep.h"
|
||||||
|
#include "autotoolsbuildconfiguration.h"
|
||||||
|
#include "autotoolsbuildsystem.h"
|
||||||
|
#include "autotoolsprojectconstants.h"
|
||||||
#include "configurestep.h"
|
#include "configurestep.h"
|
||||||
|
#include "makestep.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icontext.h>
|
||||||
#include <projectexplorer/projectmanager.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
|
|
||||||
namespace AutotoolsProjectManager {
|
namespace AutotoolsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
AutotoolsProject::AutotoolsProject(const Utils::FilePath &fileName)
|
||||||
|
: Project(Constants::MAKEFILE_MIMETYPE, fileName)
|
||||||
|
{
|
||||||
|
setId(Constants::AUTOTOOLS_PROJECT_ID);
|
||||||
|
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
||||||
|
setDisplayName(projectDirectory().fileName());
|
||||||
|
|
||||||
|
setHasMakeInstallEquivalent(true);
|
||||||
|
|
||||||
|
setBuildSystem(std::make_unique<AutotoolsBuildSystem>(this));
|
||||||
|
}
|
||||||
|
|
||||||
class AutotoolsProjectPluginPrivate
|
class AutotoolsProjectPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -69,5 +83,5 @@ bool AutotoolsProjectPlugin::initialize(const QStringList &arguments,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Internal
|
} // namespace Internal
|
||||||
} // AutotoolsProjectManager
|
} // AutotoolsProjectManager
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace AutotoolsProjectManager {
|
namespace AutotoolsProjectManager {
|
||||||
@@ -73,5 +75,19 @@ class AutotoolsProjectPlugin : public ExtensionSystem::IPlugin
|
|||||||
class AutotoolsProjectPluginPrivate *d;
|
class AutotoolsProjectPluginPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 ProjectExplorer::Project
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AutotoolsProject(const Utils::FilePath &fileName);
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace AutotoolsProjectManager
|
} // namespace AutotoolsProjectManager
|
||||||
|
@@ -26,23 +26,16 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "configurestep.h"
|
#include "configurestep.h"
|
||||||
#include "autotoolsproject.h"
|
|
||||||
#include "autotoolsbuildconfiguration.h"
|
#include "autotoolsbuildconfiguration.h"
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
#include <projectexplorer/toolchain.h>
|
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
|
||||||
#include <projectexplorer/processparameters.h>
|
#include <projectexplorer/processparameters.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <utils/qtcprocess.h>
|
|
||||||
|
|
||||||
#include <QVariantMap>
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QLineEdit>
|
#include <QDir>
|
||||||
#include <QFormLayout>
|
|
||||||
|
|
||||||
using namespace AutotoolsProjectManager;
|
using namespace AutotoolsProjectManager;
|
||||||
using namespace AutotoolsProjectManager::Internal;
|
using namespace AutotoolsProjectManager::Internal;
|
||||||
@@ -55,7 +48,7 @@ using namespace Utils;
|
|||||||
static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) {
|
static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) {
|
||||||
const QDir buildDir(bc->buildDirectory().toString());
|
const QDir buildDir(bc->buildDirectory().toString());
|
||||||
QString projDirToBuildDir = buildDir.relativeFilePath(
|
QString projDirToBuildDir = buildDir.relativeFilePath(
|
||||||
bc->target()->project()->projectDirectory().toString());
|
bc->project()->projectDirectory().toString());
|
||||||
if (projDirToBuildDir.isEmpty())
|
if (projDirToBuildDir.isEmpty())
|
||||||
return QString("./");
|
return QString("./");
|
||||||
if (!projDirToBuildDir.endsWith('/'))
|
if (!projDirToBuildDir.endsWith('/'))
|
||||||
@@ -106,7 +99,6 @@ ConfigureStep::ConfigureStep(BuildStepList *bsl)
|
|||||||
|
|
||||||
return param.summaryInWorkdir(displayName());
|
return param.summaryInWorkdir(displayName());
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigureStep::init()
|
bool ConfigureStep::init()
|
||||||
|
@@ -30,10 +30,9 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfoList>
|
#include <QFile>
|
||||||
#include <QMutexLocker>
|
#include <QFileInfo>
|
||||||
|
|
||||||
using namespace AutotoolsProjectManager::Internal;
|
using namespace AutotoolsProjectManager::Internal;
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ bool MakefileParser::parse()
|
|||||||
{
|
{
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
m_cancel = false;
|
m_cancel = false;
|
||||||
m_mutex.unlock(),
|
m_mutex.unlock();
|
||||||
|
|
||||||
m_success = true;
|
m_success = true;
|
||||||
m_executable.clear();
|
m_executable.clear();
|
||||||
|
@@ -26,9 +26,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "makestep.h"
|
#include "makestep.h"
|
||||||
#include "autotoolsproject.h"
|
|
||||||
#include "autotoolsprojectconstants.h"
|
#include "autotoolsprojectconstants.h"
|
||||||
#include "autotoolsbuildconfiguration.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
@@ -232,6 +232,7 @@ public:
|
|||||||
|
|
||||||
// FIXME: Make this private and the BuildSystem a friend
|
// FIXME: Make this private and the BuildSystem a friend
|
||||||
ParseGuard guardParsingRun() { return ParseGuard(this); }
|
ParseGuard guardParsingRun() { return ParseGuard(this); }
|
||||||
|
void setRootProjectNode(std::unique_ptr<ProjectNode> &&root);
|
||||||
|
|
||||||
// Set project files that will be watched and trigger the same callback
|
// Set project files that will be watched and trigger the same callback
|
||||||
// as the main project file.
|
// as the main project file.
|
||||||
@@ -285,7 +286,6 @@ protected:
|
|||||||
void setCanBuildProducts();
|
void setCanBuildProducts();
|
||||||
|
|
||||||
void setId(Core::Id id);
|
void setId(Core::Id id);
|
||||||
void setRootProjectNode(std::unique_ptr<ProjectNode> &&root); // takes ownership!
|
|
||||||
void setProjectLanguages(Core::Context language);
|
void setProjectLanguages(Core::Context language);
|
||||||
void addProjectLanguage(Core::Id id);
|
void addProjectLanguage(Core::Id id);
|
||||||
void removeProjectLanguage(Core::Id id);
|
void removeProjectLanguage(Core::Id id);
|
||||||
|
Reference in New Issue
Block a user