File: FirstConfigure.h

package info (click to toggle)
cmake 4.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 147,412 kB
  • sloc: ansic: 403,924; cpp: 290,826; sh: 4,091; python: 3,357; yacc: 3,106; lex: 1,189; f90: 532; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 230; perl: 217; objc: 215; xml: 198; makefile: 98; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (218 lines) | stat: -rw-r--r-- 5,100 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218

#pragma once

#include <QWizard>
#include <QWizardPage>

#include "cmake.h"

#include "ui_Compilers.h"
#include "ui_CrossCompiler.h"

class QRadioButton;
class QComboBox;

//! the wizard pages we'll use for the first configure of a build
enum FirstConfigurePages
{
  Start,
  NativeSetup,
  ToolchainSetup,
  CrossSetup,
  Done
};

enum class CompilerOption
{
  DefaultPreset,
  DefaultNative,
  SpecifyNative,
  ToolchainFile,
  Options,
};

//! the first page that gives basic options for what compilers setup to choose
//! from
class StartCompilerSetup : public QWizardPage
{
  Q_OBJECT
public:
  StartCompilerSetup(QString defaultGeneratorPlatform,
                     QString defaultGeneratorToolset, QWidget* p);
  ~StartCompilerSetup();
  void setGenerators(std::vector<cmake::GeneratorInfo> const& gens);
  void setCurrentGenerator(QString const& gen);
  void setToolset(QString const& toolset);
  void setPlatform(QString const& platform);
  void setCompilerOption(CompilerOption option);
  QString getGenerator() const;
  QString getToolset() const;
  QString getPlatform() const;

  bool defaultSetup() const;
  bool compilerSetup() const;
  bool crossCompilerSetup() const;
  bool crossCompilerToolChainFile() const;

  int nextId() const;

signals:
  void selectionChanged();

protected slots:
  void onSelectionChanged(bool);
  void onGeneratorChanged(int index);

protected:
  QComboBox* GeneratorOptions;
  QRadioButton* CompilerSetupOptions[4];
  QFrame* ToolsetFrame;
  QLineEdit* Toolset;
  QLabel* ToolsetLabel;
  QFrame* PlatformFrame;
  QComboBox* PlatformOptions;
  QLabel* PlatformLabel;
  QStringList GeneratorsSupportingToolset;
  QStringList GeneratorsSupportingPlatform;
  QMultiMap<QString, QString> GeneratorSupportedPlatforms;
  QMap<QString, QString> GeneratorDefaultPlatform;
  QString DefaultGeneratorPlatform, DefaultGeneratorToolset;

private:
  QFrame* CreateToolsetWidgets();
  QFrame* CreatePlatformWidgets();
};

//! the page that gives basic options for native compilers
class NativeCompilerSetup
  : public QWizardPage
  , protected Ui::Compilers
{
  Q_OBJECT
public:
  NativeCompilerSetup(QWidget* p);
  ~NativeCompilerSetup();

  QString getCCompiler() const;
  void setCCompiler(QString const&);

  QString getCXXCompiler() const;
  void setCXXCompiler(QString const&);

  QString getFortranCompiler() const;
  void setFortranCompiler(QString const&);

  int nextId() const { return -1; }
};

//! the page that gives options for cross compilers
class CrossCompilerSetup
  : public QWizardPage
  , protected Ui::CrossCompiler
{
  Q_OBJECT
public:
  CrossCompilerSetup(QWidget* p);
  ~CrossCompilerSetup();

  QString getSystem() const;
  void setSystem(QString const&);

  QString getVersion() const;
  void setVersion(QString const&);

  QString getProcessor() const;
  void setProcessor(QString const&);

  QString getCCompiler() const;
  void setCCompiler(QString const&);

  QString getCXXCompiler() const;
  void setCXXCompiler(QString const&);

  QString getFortranCompiler() const;
  void setFortranCompiler(QString const&);

  QString getFindRoot() const;
  void setFindRoot(QString const&);

  enum CrossMode
  {
    BOTH,
    ONLY,
    NEVER
  };

  int getProgramMode() const;
  void setProgramMode(int);
  int getLibraryMode() const;
  void setLibraryMode(int);
  int getIncludeMode() const;
  void setIncludeMode(int);

  int nextId() const { return -1; }
};

//! the page that gives options for a toolchain file
class ToolchainCompilerSetup : public QWizardPage
{
  Q_OBJECT
public:
  ToolchainCompilerSetup(QWidget* p);
  ~ToolchainCompilerSetup();

  QString toolchainFile() const;
  void setToolchainFile(QString const&);

  int nextId() const { return -1; }

protected:
  QCMakeFilePathEditor* ToolchainFile;
};

//! the wizard with the pages
class FirstConfigure : public QWizard
{
  Q_OBJECT
public:
  FirstConfigure();
  ~FirstConfigure();

  void setGenerators(std::vector<cmake::GeneratorInfo> const& gens);
  void setCurrentGenerator(QString const& gen);
  void setToolset(QString const& toolset);
  void setPlatform(QString const& platform);
  void setCompilerOption(CompilerOption option);
  QString getGenerator() const;
  QString getPlatform() const;
  QString getToolset() const;

  bool defaultSetup() const;
  bool compilerSetup() const;
  bool crossCompilerSetup() const;
  bool crossCompilerToolChainFile() const;

  QString getCCompiler() const;
  QString getCXXCompiler() const;
  QString getFortranCompiler() const;

  QString getSystemName() const;
  QString getSystemVersion() const;
  QString getSystemProcessor() const;
  QString getCrossRoot() const;
  QString getCrossProgramMode() const;
  QString getCrossLibraryMode() const;
  QString getCrossIncludeMode() const;

  QString getCrossCompilerToolChainFile() const;

  void loadFromSettings();
  void saveToSettings();

protected:
  StartCompilerSetup* mStartCompilerSetupPage;
  NativeCompilerSetup* mNativeCompilerSetupPage;
  CrossCompilerSetup* mCrossCompilerSetupPage;
  ToolchainCompilerSetup* mToolchainCompilerSetupPage;
  QString mDefaultGenerator;
};