1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef CMAKEPROJECTMANAGER_H
35 #define CMAKEPROJECTMANAGER_H
37 #include <projectexplorer/iprojectmanager.h>
38 #include <coreplugin/dialogs/ioptionspage.h>
39 #include <coreplugin/icontext.h>
41 #include <utils/environment.h>
42 #include <utils/pathchooser.h>
44 #include <QtCore/QFuture>
45 #include <QtCore/QStringList>
46 #include <QtCore/QDir>
48 QT_FORWARD_DECLARE_CLASS(QProcess)
49 QT_FORWARD_DECLARE_CLASS(QLabel)
55 namespace CMakeProjectManager {
58 class CMakeSettingsPage;
60 class CMakeManager : public ProjectExplorer::IProjectManager
64 CMakeManager(CMakeSettingsPage *cmakeSettingsPage);
66 virtual Core::Context projectContext() const;
67 virtual Core::Context projectLanguage() const;
69 virtual ProjectExplorer::Project *openProject(const QString &fileName);
70 virtual QString mimeType() const;
72 QString cmakeExecutable() const;
73 bool isCMakeExecutableValid() const;
75 void setCMakeExecutable(const QString &executable);
77 void createXmlFile(Utils::QtcProcess *process,
78 const QString &arguments,
79 const QString &sourceDirectory,
80 const QDir &buildDirectory,
81 const Utils::Environment &env,
82 const QString &generator);
83 bool hasCodeBlocksMsvcGenerator() const;
84 static QString findCbpFile(const QDir &);
86 static QString findDumperLibrary(const Utils::Environment &env);
88 static QString qtVersionForQMake(const QString &qmakePath);
89 static QPair<QString, QString> findQtDir(const Utils::Environment &env);
90 Core::Context m_projectContext;
91 Core::Context m_projectLanguage;
92 CMakeSettingsPage *m_settingsPage;
95 class CMakeSettingsPage : public Core::IOptionsPage
100 virtual ~CMakeSettingsPage();
101 virtual QString id() const;
102 virtual QString displayName() const;
103 virtual QString category() const;
104 virtual QString displayCategory() const;
105 virtual QIcon categoryIcon() const;
107 virtual QWidget *createPage(QWidget *parent);
108 virtual void apply();
109 virtual void finish();
111 QString cmakeExecutable() const;
112 void setCMakeExecutable(const QString &executable);
113 bool isCMakeExecutableValid();
114 bool hasCodeBlocksMsvcGenerator() const;
116 void cmakeFinished();
118 void saveSettings() const;
120 QString findCmakeExecutable() const;
123 Utils::PathChooser *m_pathchooser;
124 QString m_cmakeExecutable;
125 enum STATE { VALID, INVALID, RUNNING } m_state;
128 bool m_hasCodeBlocksMsvcGenerator;
131 } // namespace Internal
132 } // namespace CMakeProjectManager
134 #endif // CMAKEPROJECTMANAGER_H