2015-03-10 10:22:38 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2015-03-10 10:22:38 +01:00
|
|
|
**
|
|
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2015-03-10 10:22:38 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2015-03-10 10:22:38 +01:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
#ifndef CMAKECBPPARSER_H
|
|
|
|
|
#define CMAKECBPPARSER_H
|
2015-03-10 10:22:38 +01:00
|
|
|
|
|
|
|
|
#include "cmakeproject.h"
|
|
|
|
|
|
|
|
|
|
#include <QXmlStreamReader>
|
|
|
|
|
|
|
|
|
|
|
2015-03-10 15:47:09 +01:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class FileNode;
|
|
|
|
|
class Kit;
|
|
|
|
|
}
|
2015-03-10 10:22:38 +01:00
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class CMakeCbpParser : public QXmlStreamReader
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-03-10 15:47:09 +01:00
|
|
|
bool parseCbpFile(ProjectExplorer::Kit *kit, const QString &fileName, const QString &sourceDirectory);
|
2015-03-10 10:22:38 +01:00
|
|
|
QList<ProjectExplorer::FileNode *> fileList();
|
|
|
|
|
QList<ProjectExplorer::FileNode *> cmakeFileList();
|
|
|
|
|
QList<CMakeBuildTarget> buildTargets();
|
|
|
|
|
QString projectName() const;
|
|
|
|
|
QString compilerName() const;
|
|
|
|
|
bool hasCMakeFiles();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void parseCodeBlocks_project_file();
|
|
|
|
|
void parseProject();
|
|
|
|
|
void parseBuild();
|
|
|
|
|
void parseOption();
|
|
|
|
|
void parseBuildTarget();
|
|
|
|
|
void parseBuildTargetOption();
|
|
|
|
|
void parseMakeCommands();
|
|
|
|
|
void parseBuildTargetBuild();
|
|
|
|
|
void parseBuildTargetClean();
|
|
|
|
|
void parseCompiler();
|
|
|
|
|
void parseAdd();
|
|
|
|
|
void parseUnit();
|
|
|
|
|
void parseUnitOption();
|
|
|
|
|
void parseUnknownElement();
|
|
|
|
|
void sortFiles();
|
|
|
|
|
|
2015-04-21 12:42:17 -07:00
|
|
|
QMap<Utils::FileName, QString> m_unitTargetMap;
|
2016-01-07 15:22:53 +01:00
|
|
|
ProjectExplorer::Kit *m_kit = 0;
|
2015-03-10 10:22:38 +01:00
|
|
|
QList<ProjectExplorer::FileNode *> m_fileList;
|
|
|
|
|
QList<ProjectExplorer::FileNode *> m_cmakeFileList;
|
|
|
|
|
QSet<Utils::FileName> m_processedUnits;
|
|
|
|
|
bool m_parsingCmakeUnit;
|
|
|
|
|
|
|
|
|
|
CMakeBuildTarget m_buildTarget;
|
|
|
|
|
QList<CMakeBuildTarget> m_buildTargets;
|
|
|
|
|
QString m_projectName;
|
|
|
|
|
QString m_compiler;
|
|
|
|
|
QString m_sourceDirectory;
|
|
|
|
|
QString m_buildDirectory;
|
2015-04-21 12:42:17 -07:00
|
|
|
QString m_unitTarget;
|
2015-03-10 10:22:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|
|
|
|
|
|
2016-01-07 15:22:53 +01:00
|
|
|
#endif // CMAKECBPPARSER_H
|