2016-12-05 15:24:09 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2017-02-06 16:59:53 +01:00
|
|
|
** Copyright (C) 2017 The Qt Company Ltd.
|
2016-12-05 15:24:09 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "cpptools_global.h"
|
|
|
|
|
|
2019-08-28 13:04:16 +02:00
|
|
|
#include <projectexplorer/buildtargettype.h>
|
|
|
|
|
#include <projectexplorer/projectexplorer_global.h>
|
2017-02-06 16:59:53 +01:00
|
|
|
#include <projectexplorer/toolchain.h>
|
2019-01-09 18:31:20 +01:00
|
|
|
#include <utils/cpplanguage_details.h>
|
2017-02-06 16:59:53 +01:00
|
|
|
|
2016-12-05 15:24:09 +01:00
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
|
|
namespace CppTools {
|
|
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
class CPPTOOLS_EXPORT RawProjectPartFlags
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RawProjectPartFlags() = default;
|
|
|
|
|
RawProjectPartFlags(const ProjectExplorer::ToolChain *toolChain,
|
|
|
|
|
const QStringList &commandLineFlags);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QStringList commandLineFlags;
|
|
|
|
|
// The following are deduced from commandLineFlags.
|
|
|
|
|
ProjectExplorer::WarningFlags warningFlags = ProjectExplorer::WarningFlags::Default;
|
2019-01-09 18:31:20 +01:00
|
|
|
Utils::LanguageExtensions languageExtensions = Utils::LanguageExtension::None;
|
2017-02-06 16:59:53 +01:00
|
|
|
};
|
2016-12-05 15:24:09 +01:00
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
class CPPTOOLS_EXPORT RawProjectPart
|
2016-12-05 15:24:09 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void setDisplayName(const QString &displayName);
|
|
|
|
|
|
2017-03-09 14:13:22 +01:00
|
|
|
void setProjectFileLocation(const QString &projectFile, int line = -1, int column = -1);
|
2016-12-05 15:24:09 +01:00
|
|
|
void setConfigFileName(const QString &configFileName);
|
2017-02-27 14:37:41 +01:00
|
|
|
void setCallGroupId(const QString &id);
|
2016-12-05 15:24:09 +01:00
|
|
|
|
2019-08-28 12:23:37 +02:00
|
|
|
// FileIsActive and GetMimeType must be thread-safe.
|
|
|
|
|
using FileIsActive = std::function<bool(const QString &filePath)>;
|
|
|
|
|
using GetMimeType = std::function<QString(const QString &filePath)>;
|
|
|
|
|
void setFiles(const QStringList &files,
|
|
|
|
|
const FileIsActive &fileIsActive = {},
|
|
|
|
|
const GetMimeType &getMimeType = {});
|
2019-06-12 12:48:07 +02:00
|
|
|
static ProjectExplorer::HeaderPath frameworkDetectionHeuristic(const ProjectExplorer::HeaderPath &header);
|
2018-09-03 16:10:43 +02:00
|
|
|
void setHeaderPaths(const ProjectExplorer::HeaderPaths &headerPaths);
|
2016-12-05 15:24:09 +01:00
|
|
|
void setIncludePaths(const QStringList &includePaths);
|
|
|
|
|
void setPreCompiledHeaders(const QStringList &preCompiledHeaders);
|
|
|
|
|
|
2019-01-08 15:13:48 +01:00
|
|
|
void setBuildSystemTarget(const QString &target);
|
2019-08-28 13:04:16 +02:00
|
|
|
void setBuildTargetType(ProjectExplorer::BuildTargetType type);
|
2016-12-05 17:30:56 +01:00
|
|
|
void setSelectedForBuilding(bool yesno);
|
|
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
void setFlagsForC(const RawProjectPartFlags &flags);
|
|
|
|
|
void setFlagsForCxx(const RawProjectPartFlags &flags);
|
|
|
|
|
|
2019-01-08 15:13:48 +01:00
|
|
|
void setMacros(const ProjectExplorer::Macros ¯os);
|
2019-08-28 13:04:16 +02:00
|
|
|
void setQtVersion(Utils::QtVersion qtVersion);
|
2019-01-08 15:13:48 +01:00
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
public:
|
|
|
|
|
QString displayName;
|
2019-01-08 15:13:48 +01:00
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
QString projectFile;
|
2017-02-27 14:02:38 +01:00
|
|
|
int projectFileLine = -1;
|
|
|
|
|
int projectFileColumn = -1;
|
2017-02-27 14:37:41 +01:00
|
|
|
QString callGroupId;
|
2019-01-08 15:13:48 +01:00
|
|
|
|
|
|
|
|
// Files
|
|
|
|
|
QStringList files;
|
2019-08-28 12:23:37 +02:00
|
|
|
FileIsActive fileIsActive;
|
|
|
|
|
GetMimeType getMimeType;
|
2017-02-06 16:59:53 +01:00
|
|
|
QStringList precompiledHeaders;
|
2018-09-03 16:10:43 +02:00
|
|
|
ProjectExplorer::HeaderPaths headerPaths;
|
2019-01-08 15:13:48 +01:00
|
|
|
QString projectConfigFile; // Generic Project Manager only
|
|
|
|
|
|
|
|
|
|
// Build system
|
|
|
|
|
QString buildSystemTarget;
|
2019-08-28 13:04:16 +02:00
|
|
|
ProjectExplorer::BuildTargetType buildTargetType = ProjectExplorer::BuildTargetType::Unknown;
|
2017-02-06 16:59:53 +01:00
|
|
|
bool selectedForBuilding = true;
|
|
|
|
|
|
2019-01-08 15:13:48 +01:00
|
|
|
// Flags
|
2017-02-06 16:59:53 +01:00
|
|
|
RawProjectPartFlags flagsForC;
|
|
|
|
|
RawProjectPartFlags flagsForCxx;
|
|
|
|
|
|
2019-01-08 15:13:48 +01:00
|
|
|
// Misc
|
|
|
|
|
ProjectExplorer::Macros projectMacros;
|
2019-08-28 13:04:16 +02:00
|
|
|
Utils::QtVersion qtVersion = Utils::QtVersion::Unknown;
|
2016-12-05 15:24:09 +01:00
|
|
|
};
|
|
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
using RawProjectParts = QVector<RawProjectPart>;
|
|
|
|
|
|
2016-12-05 15:24:09 +01:00
|
|
|
} // namespace CppTools
|