f3c4a8be51e26178675c19a203ff15207fe2ac63
[platform/upstream/cmake.git] / Source / QtDialog / FirstConfigure.cxx
1
2 #include "FirstConfigure.h"
3
4 #include <QComboBox>
5 #include <QRadioButton>
6 #include <QSettings>
7 #include <QVBoxLayout>
8
9 #include "cmStringAlgorithms.h"
10
11 #include "Compilers.h"
12
13 StartCompilerSetup::StartCompilerSetup(QString defaultGeneratorPlatform,
14                                        QString defaultGeneratorToolset,
15                                        QWidget* p)
16   : QWizardPage(p)
17   , DefaultGeneratorPlatform(std::move(defaultGeneratorPlatform))
18   , DefaultGeneratorToolset(std::move(defaultGeneratorToolset))
19 {
20   QVBoxLayout* l = new QVBoxLayout(this);
21   l->addWidget(new QLabel(tr("Specify the generator for this project")));
22   this->GeneratorOptions = new QComboBox(this);
23   l->addWidget(this->GeneratorOptions);
24
25   // Add the generator platform
26   this->PlatformFrame = CreatePlatformWidgets();
27   l->addWidget(PlatformFrame);
28
29   // Add the ability to specify toolset (-T parameter)
30   this->ToolsetFrame = CreateToolsetWidgets();
31   l->addWidget(ToolsetFrame);
32
33   l->addSpacing(6);
34
35   this->CompilerSetupOptions[0] =
36     new QRadioButton(tr("Use default native compilers"), this);
37   this->CompilerSetupOptions[1] =
38     new QRadioButton(tr("Specify native compilers"), this);
39   this->CompilerSetupOptions[2] =
40     new QRadioButton(tr("Specify toolchain file for cross-compiling"), this);
41   this->CompilerSetupOptions[3] =
42     new QRadioButton(tr("Specify options for cross-compiling"), this);
43   l->addWidget(this->CompilerSetupOptions[0]);
44   l->addWidget(this->CompilerSetupOptions[1]);
45   l->addWidget(this->CompilerSetupOptions[2]);
46   l->addWidget(this->CompilerSetupOptions[3]);
47
48   this->CompilerSetupOptions[0]->setChecked(true);
49
50   QObject::connect(this->CompilerSetupOptions[0], &QRadioButton::toggled, this,
51                    &StartCompilerSetup::onSelectionChanged);
52   QObject::connect(this->CompilerSetupOptions[1], &QRadioButton::toggled, this,
53                    &StartCompilerSetup::onSelectionChanged);
54   QObject::connect(this->CompilerSetupOptions[2], &QRadioButton::toggled, this,
55                    &StartCompilerSetup::onSelectionChanged);
56   QObject::connect(this->CompilerSetupOptions[3], &QRadioButton::toggled, this,
57                    &StartCompilerSetup::onSelectionChanged);
58   QObject::connect(
59     this->GeneratorOptions,
60     static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
61     this, &StartCompilerSetup::onGeneratorChanged);
62 }
63
64 QFrame* StartCompilerSetup::CreateToolsetWidgets()
65 {
66   QFrame* frame = new QFrame(this);
67   QVBoxLayout* l = new QVBoxLayout(frame);
68   l->setContentsMargins(0, 0, 0, 0);
69
70   ToolsetLabel = new QLabel(tr("Optional toolset to use (argument to -T)"));
71   l->addWidget(ToolsetLabel);
72
73   Toolset = new QLineEdit(frame);
74   l->addWidget(Toolset);
75
76   // Default to CMAKE_GENERATOR_TOOLSET env var if set
77   if (!DefaultGeneratorToolset.isEmpty()) {
78     this->Toolset->setText(DefaultGeneratorToolset);
79   }
80   return frame;
81 }
82
83 QFrame* StartCompilerSetup::CreatePlatformWidgets()
84 {
85   QFrame* frame = new QFrame(this);
86   QVBoxLayout* l = new QVBoxLayout(frame);
87   l->setContentsMargins(0, 0, 0, 0);
88
89   this->PlatformLabel = new QLabel(tr("Optional platform for generator"));
90   l->addWidget(this->PlatformLabel);
91
92   this->PlatformOptions = new QComboBox(frame);
93   this->PlatformOptions->setEditable(true);
94
95   l->addWidget(this->PlatformOptions);
96
97   return frame;
98 }
99
100 StartCompilerSetup::~StartCompilerSetup() = default;
101
102 void StartCompilerSetup::setGenerators(
103   std::vector<cmake::GeneratorInfo> const& gens)
104 {
105   this->GeneratorOptions->clear();
106
107   QStringList generator_list;
108
109   for (cmake::GeneratorInfo const& gen : gens) {
110     generator_list.append(QString::fromStdString(gen.name));
111
112     if (gen.supportsPlatform) {
113       this->GeneratorsSupportingPlatform.append(
114         QString::fromStdString(gen.name));
115
116       this->GeneratorDefaultPlatform[QString::fromStdString(gen.name)] =
117         QString::fromStdString(gen.defaultPlatform);
118
119       auto platformIt = gen.supportedPlatforms.cbegin();
120       while (platformIt != gen.supportedPlatforms.cend()) {
121
122         this->GeneratorSupportedPlatforms.insert(
123           QString::fromStdString(gen.name),
124           QString::fromStdString((*platformIt)));
125
126         platformIt++;
127       }
128     }
129
130     if (gen.supportsToolset) {
131       this->GeneratorsSupportingToolset.append(
132         QString::fromStdString(gen.name));
133     }
134   }
135
136   this->GeneratorOptions->addItems(generator_list);
137 }
138
139 void StartCompilerSetup::setCurrentGenerator(const QString& gen)
140 {
141   int idx = this->GeneratorOptions->findText(gen);
142   if (idx != -1) {
143     this->GeneratorOptions->setCurrentIndex(idx);
144   }
145 }
146
147 void StartCompilerSetup::setPlatform(const QString& platform)
148 {
149   this->PlatformOptions->setCurrentText(platform);
150 }
151
152 void StartCompilerSetup::setToolset(const QString& toolset)
153 {
154   this->Toolset->setText(toolset);
155 }
156
157 void StartCompilerSetup::setCompilerOption(CompilerOption option)
158 {
159   std::size_t index = 0;
160   switch (option) {
161     case CompilerOption::DefaultNative:
162       index = 0;
163       break;
164     case CompilerOption::SpecifyNative:
165       index = 1;
166       break;
167     case CompilerOption::ToolchainFile:
168       index = 2;
169       break;
170     case CompilerOption::Options:
171       index = 3;
172       break;
173   }
174   this->CompilerSetupOptions[index]->setChecked(true);
175 }
176
177 QString StartCompilerSetup::getGenerator() const
178 {
179   return this->GeneratorOptions->currentText();
180 };
181
182 QString StartCompilerSetup::getPlatform() const
183 {
184   return this->PlatformOptions->currentText();
185 };
186
187 QString StartCompilerSetup::getToolset() const
188 {
189   return this->Toolset->text();
190 };
191
192 bool StartCompilerSetup::defaultSetup() const
193 {
194   return this->CompilerSetupOptions[0]->isChecked();
195 }
196
197 bool StartCompilerSetup::compilerSetup() const
198 {
199   return this->CompilerSetupOptions[1]->isChecked();
200 }
201
202 bool StartCompilerSetup::crossCompilerToolChainFile() const
203 {
204   return this->CompilerSetupOptions[2]->isChecked();
205 }
206
207 bool StartCompilerSetup::crossCompilerSetup() const
208 {
209   return this->CompilerSetupOptions[3]->isChecked();
210 }
211
212 void StartCompilerSetup::onSelectionChanged(bool on)
213 {
214   if (on) {
215     emit selectionChanged();
216   }
217 }
218
219 void StartCompilerSetup::onGeneratorChanged(int index)
220 {
221   QString name = this->GeneratorOptions->itemText(index);
222
223   // Display the generator platform for the generators supporting it
224   if (GeneratorsSupportingPlatform.contains(name)) {
225
226     // Change the label title to include the default platform
227     std::string label =
228       cmStrCat("Optional platform for generator(if empty, generator uses: ",
229                this->GeneratorDefaultPlatform[name].toStdString(), ')');
230     this->PlatformLabel->setText(tr(label.c_str()));
231
232     // Regenerate the list of supported platform
233     this->PlatformOptions->clear();
234     QStringList platform_list;
235     platform_list.append("");
236
237     QList<QString> platforms = this->GeneratorSupportedPlatforms.values(name);
238     platform_list.append(platforms);
239
240     this->PlatformOptions->addItems(platform_list);
241     PlatformFrame->show();
242
243     // Default to generator platform from environment
244     if (!DefaultGeneratorPlatform.isEmpty()) {
245       int platform_index = platforms.indexOf(DefaultGeneratorPlatform);
246       if (platform_index != -1) {
247         this->PlatformOptions->setCurrentIndex(platform_index);
248       }
249     }
250   } else {
251     PlatformFrame->hide();
252   }
253
254   // Display the toolset box for the generators supporting it
255   if (GeneratorsSupportingToolset.contains(name)) {
256     ToolsetFrame->show();
257   } else {
258     ToolsetFrame->hide();
259   }
260 }
261
262 int StartCompilerSetup::nextId() const
263 {
264   if (compilerSetup()) {
265     return NativeSetup;
266   }
267   if (crossCompilerSetup()) {
268     return CrossSetup;
269   }
270   if (crossCompilerToolChainFile()) {
271     return ToolchainSetup;
272   }
273   return -1;
274 }
275
276 NativeCompilerSetup::NativeCompilerSetup(QWidget* p)
277   : QWizardPage(p)
278 {
279   QVBoxLayout* l = new QVBoxLayout(this);
280   QWidget* c = new QWidget(this);
281   l->addWidget(c);
282   this->setupUi(c);
283 }
284
285 NativeCompilerSetup::~NativeCompilerSetup() = default;
286
287 QString NativeCompilerSetup::getCCompiler() const
288 {
289   return this->CCompiler->text();
290 }
291
292 void NativeCompilerSetup::setCCompiler(const QString& s)
293 {
294   this->CCompiler->setText(s);
295 }
296
297 QString NativeCompilerSetup::getCXXCompiler() const
298 {
299   return this->CXXCompiler->text();
300 }
301
302 void NativeCompilerSetup::setCXXCompiler(const QString& s)
303 {
304   this->CXXCompiler->setText(s);
305 }
306
307 QString NativeCompilerSetup::getFortranCompiler() const
308 {
309   return this->FortranCompiler->text();
310 }
311
312 void NativeCompilerSetup::setFortranCompiler(const QString& s)
313 {
314   this->FortranCompiler->setText(s);
315 }
316
317 CrossCompilerSetup::CrossCompilerSetup(QWidget* p)
318   : QWizardPage(p)
319 {
320   this->setupUi(this);
321   QWidget::setTabOrder(systemName, systemVersion);
322   QWidget::setTabOrder(systemVersion, systemProcessor);
323   QWidget::setTabOrder(systemProcessor, CrossCompilers->CCompiler);
324   QWidget::setTabOrder(CrossCompilers->CCompiler, CrossCompilers->CXXCompiler);
325   QWidget::setTabOrder(CrossCompilers->CXXCompiler,
326                        CrossCompilers->FortranCompiler);
327   QWidget::setTabOrder(CrossCompilers->FortranCompiler, crossFindRoot);
328   QWidget::setTabOrder(crossFindRoot, crossProgramMode);
329   QWidget::setTabOrder(crossProgramMode, crossLibraryMode);
330   QWidget::setTabOrder(crossLibraryMode, crossIncludeMode);
331
332   // fill in combo boxes
333   QStringList modes;
334   modes << tr("Search in Target Root, then native system");
335   modes << tr("Search only in Target Root");
336   modes << tr("Search only in native system");
337   crossProgramMode->addItems(modes);
338   crossLibraryMode->addItems(modes);
339   crossIncludeMode->addItems(modes);
340   crossProgramMode->setCurrentIndex(2);
341   crossLibraryMode->setCurrentIndex(1);
342   crossIncludeMode->setCurrentIndex(1);
343
344   this->registerField("systemName*", this->systemName);
345 }
346
347 CrossCompilerSetup::~CrossCompilerSetup() = default;
348
349 QString CrossCompilerSetup::getCCompiler() const
350 {
351   return this->CrossCompilers->CCompiler->text();
352 }
353
354 void CrossCompilerSetup::setCCompiler(const QString& s)
355 {
356   this->CrossCompilers->CCompiler->setText(s);
357 }
358
359 QString CrossCompilerSetup::getCXXCompiler() const
360 {
361   return this->CrossCompilers->CXXCompiler->text();
362 }
363
364 void CrossCompilerSetup::setCXXCompiler(const QString& s)
365 {
366   this->CrossCompilers->CXXCompiler->setText(s);
367 }
368
369 QString CrossCompilerSetup::getFortranCompiler() const
370 {
371   return this->CrossCompilers->FortranCompiler->text();
372 }
373
374 void CrossCompilerSetup::setFortranCompiler(const QString& s)
375 {
376   this->CrossCompilers->FortranCompiler->setText(s);
377 }
378
379 QString CrossCompilerSetup::getSystem() const
380 {
381   return this->systemName->text();
382 }
383
384 void CrossCompilerSetup::setSystem(const QString& t)
385 {
386   this->systemName->setText(t);
387 }
388
389 QString CrossCompilerSetup::getVersion() const
390 {
391   return this->systemVersion->text();
392 }
393
394 void CrossCompilerSetup::setVersion(const QString& t)
395 {
396   this->systemVersion->setText(t);
397 }
398
399 QString CrossCompilerSetup::getProcessor() const
400 {
401   return this->systemProcessor->text();
402 }
403
404 void CrossCompilerSetup::setProcessor(const QString& t)
405 {
406   this->systemProcessor->setText(t);
407 }
408
409 QString CrossCompilerSetup::getFindRoot() const
410 {
411   return this->crossFindRoot->text();
412 }
413
414 void CrossCompilerSetup::setFindRoot(const QString& t)
415 {
416   this->crossFindRoot->setText(t);
417 }
418
419 int CrossCompilerSetup::getProgramMode() const
420 {
421   return this->crossProgramMode->currentIndex();
422 }
423
424 int CrossCompilerSetup::getLibraryMode() const
425 {
426   return this->crossLibraryMode->currentIndex();
427 }
428
429 int CrossCompilerSetup::getIncludeMode() const
430 {
431   return this->crossIncludeMode->currentIndex();
432 }
433
434 void CrossCompilerSetup::setProgramMode(int m)
435 {
436   this->crossProgramMode->setCurrentIndex(m);
437 }
438
439 void CrossCompilerSetup::setLibraryMode(int m)
440 {
441   this->crossLibraryMode->setCurrentIndex(m);
442 }
443
444 void CrossCompilerSetup::setIncludeMode(int m)
445 {
446   this->crossIncludeMode->setCurrentIndex(m);
447 }
448
449 ToolchainCompilerSetup::ToolchainCompilerSetup(QWidget* p)
450   : QWizardPage(p)
451 {
452   QVBoxLayout* l = new QVBoxLayout(this);
453   l->addWidget(new QLabel(tr("Specify the Toolchain file")));
454   this->ToolchainFile = new QCMakeFilePathEditor(this);
455   l->addWidget(this->ToolchainFile);
456 }
457
458 ToolchainCompilerSetup::~ToolchainCompilerSetup() = default;
459
460 QString ToolchainCompilerSetup::toolchainFile() const
461 {
462   return this->ToolchainFile->text();
463 }
464
465 void ToolchainCompilerSetup::setToolchainFile(const QString& t)
466 {
467   this->ToolchainFile->setText(t);
468 }
469
470 FirstConfigure::FirstConfigure()
471 {
472   const char* env_generator = std::getenv("CMAKE_GENERATOR");
473   const char* env_generator_platform = nullptr;
474   const char* env_generator_toolset = nullptr;
475   if (env_generator && std::strlen(env_generator)) {
476     mDefaultGenerator = env_generator;
477     env_generator_platform = std::getenv("CMAKE_GENERATOR_PLATFORM");
478     env_generator_toolset = std::getenv("CMAKE_GENERATOR_TOOLSET");
479   }
480
481   if (!env_generator_platform) {
482     env_generator_platform = "";
483   }
484
485   if (!env_generator_toolset) {
486     env_generator_toolset = "";
487   }
488
489   // this->setOption(QWizard::HaveFinishButtonOnEarlyPages, true);
490   this->mStartCompilerSetupPage = new StartCompilerSetup(
491     env_generator_platform, env_generator_toolset, this);
492   this->setPage(Start, this->mStartCompilerSetupPage);
493   QObject::connect(this->mStartCompilerSetupPage,
494                    &StartCompilerSetup::selectionChanged, this,
495                    &FirstConfigure::restart);
496   this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
497   this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
498
499   this->mCrossCompilerSetupPage = new CrossCompilerSetup(this);
500   this->setPage(CrossSetup, this->mCrossCompilerSetupPage);
501
502   this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this);
503   this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
504 }
505
506 FirstConfigure::~FirstConfigure() = default;
507
508 void FirstConfigure::setGenerators(
509   std::vector<cmake::GeneratorInfo> const& gens)
510 {
511   this->mStartCompilerSetupPage->setGenerators(gens);
512 }
513
514 void FirstConfigure::setCurrentGenerator(const QString& gen)
515 {
516   this->mStartCompilerSetupPage->setCurrentGenerator(gen);
517 }
518
519 void FirstConfigure::setPlatform(const QString& platform)
520 {
521   this->mStartCompilerSetupPage->setPlatform(platform);
522 }
523
524 void FirstConfigure::setToolset(const QString& toolset)
525 {
526   this->mStartCompilerSetupPage->setToolset(toolset);
527 }
528
529 void FirstConfigure::setCompilerOption(CompilerOption option)
530 {
531   this->mStartCompilerSetupPage->setCompilerOption(option);
532 }
533
534 QString FirstConfigure::getGenerator() const
535 {
536   return this->mStartCompilerSetupPage->getGenerator();
537 }
538
539 QString FirstConfigure::getPlatform() const
540 {
541   return this->mStartCompilerSetupPage->getPlatform();
542 }
543
544 QString FirstConfigure::getToolset() const
545 {
546   return this->mStartCompilerSetupPage->getToolset();
547 }
548
549 void FirstConfigure::loadFromSettings()
550 {
551   QSettings settings;
552   // restore generator
553   settings.beginGroup("Settings/StartPath");
554   QString lastGen = settings.value("LastGenerator").toString();
555   this->setCurrentGenerator(lastGen);
556   settings.endGroup();
557
558   // restore compiler setup
559   settings.beginGroup("Settings/Compiler");
560   this->mNativeCompilerSetupPage->setCCompiler(
561     settings.value("CCompiler").toString());
562   this->mNativeCompilerSetupPage->setCXXCompiler(
563     settings.value("CXXCompiler").toString());
564   this->mNativeCompilerSetupPage->setFortranCompiler(
565     settings.value("FortranCompiler").toString());
566   settings.endGroup();
567
568   // restore cross compiler setup
569   settings.beginGroup("Settings/CrossCompiler");
570   this->mCrossCompilerSetupPage->setCCompiler(
571     settings.value("CCompiler").toString());
572   this->mCrossCompilerSetupPage->setCXXCompiler(
573     settings.value("CXXCompiler").toString());
574   this->mCrossCompilerSetupPage->setFortranCompiler(
575     settings.value("FortranCompiler").toString());
576   this->mToolchainCompilerSetupPage->setToolchainFile(
577     settings.value("ToolChainFile").toString());
578   this->mCrossCompilerSetupPage->setSystem(
579     settings.value("SystemName").toString());
580   this->mCrossCompilerSetupPage->setVersion(
581     settings.value("SystemVersion").toString());
582   this->mCrossCompilerSetupPage->setProcessor(
583     settings.value("SystemProcessor").toString());
584   this->mCrossCompilerSetupPage->setFindRoot(
585     settings.value("FindRoot").toString());
586   this->mCrossCompilerSetupPage->setProgramMode(
587     settings.value("ProgramMode", 0).toInt());
588   this->mCrossCompilerSetupPage->setLibraryMode(
589     settings.value("LibraryMode", 0).toInt());
590   this->mCrossCompilerSetupPage->setIncludeMode(
591     settings.value("IncludeMode", 0).toInt());
592   settings.endGroup();
593
594   // environment variables take precedence over application settings because...
595   // - they're harder to set
596   // - settings always exist after the program is run once, so the environment
597   //     variables would never be used otherwise
598   // - platform and toolset are populated only from environment variables, so
599   //     this prevents them from being taken from environment, while the
600   //     generator is taken from application settings
601   if (!mDefaultGenerator.isEmpty()) {
602     this->setCurrentGenerator(mDefaultGenerator);
603   }
604 }
605
606 void FirstConfigure::saveToSettings()
607 {
608   QSettings settings;
609
610   // save generator
611   settings.beginGroup("Settings/StartPath");
612   QString lastGen = this->mStartCompilerSetupPage->getGenerator();
613   settings.setValue("LastGenerator", lastGen);
614   settings.endGroup();
615
616   // save compiler setup
617   settings.beginGroup("Settings/Compiler");
618   settings.setValue("CCompiler",
619                     this->mNativeCompilerSetupPage->getCCompiler());
620   settings.setValue("CXXCompiler",
621                     this->mNativeCompilerSetupPage->getCXXCompiler());
622   settings.setValue("FortranCompiler",
623                     this->mNativeCompilerSetupPage->getFortranCompiler());
624   settings.endGroup();
625
626   // save cross compiler setup
627   settings.beginGroup("Settings/CrossCompiler");
628   settings.setValue("CCompiler",
629                     this->mCrossCompilerSetupPage->getCCompiler());
630   settings.setValue("CXXCompiler",
631                     this->mCrossCompilerSetupPage->getCXXCompiler());
632   settings.setValue("FortranCompiler",
633                     this->mCrossCompilerSetupPage->getFortranCompiler());
634   settings.setValue("ToolChainFile", this->getCrossCompilerToolChainFile());
635   settings.setValue("SystemName", this->mCrossCompilerSetupPage->getSystem());
636   settings.setValue("SystemVersion",
637                     this->mCrossCompilerSetupPage->getVersion());
638   settings.setValue("SystemProcessor",
639                     this->mCrossCompilerSetupPage->getProcessor());
640   settings.setValue("FindRoot", this->mCrossCompilerSetupPage->getFindRoot());
641   settings.setValue("ProgramMode",
642                     this->mCrossCompilerSetupPage->getProgramMode());
643   settings.setValue("LibraryMode",
644                     this->mCrossCompilerSetupPage->getLibraryMode());
645   settings.setValue("IncludeMode",
646                     this->mCrossCompilerSetupPage->getIncludeMode());
647   settings.endGroup();
648 }
649
650 bool FirstConfigure::defaultSetup() const
651 {
652   return this->mStartCompilerSetupPage->defaultSetup();
653 }
654
655 bool FirstConfigure::compilerSetup() const
656 {
657   return this->mStartCompilerSetupPage->compilerSetup();
658 }
659
660 bool FirstConfigure::crossCompilerSetup() const
661 {
662   return this->mStartCompilerSetupPage->crossCompilerSetup();
663 }
664
665 bool FirstConfigure::crossCompilerToolChainFile() const
666 {
667   return this->mStartCompilerSetupPage->crossCompilerToolChainFile();
668 }
669
670 QString FirstConfigure::getCrossCompilerToolChainFile() const
671 {
672   return this->mToolchainCompilerSetupPage->toolchainFile();
673 }
674
675 QString FirstConfigure::getSystemName() const
676 {
677   return this->mCrossCompilerSetupPage->getSystem();
678 }
679
680 QString FirstConfigure::getCCompiler() const
681 {
682   if (this->compilerSetup()) {
683     return this->mNativeCompilerSetupPage->getCCompiler();
684   }
685   if (this->crossCompilerSetup()) {
686     return this->mCrossCompilerSetupPage->getCCompiler();
687   }
688   return QString();
689 }
690
691 QString FirstConfigure::getCXXCompiler() const
692 {
693   if (this->compilerSetup()) {
694     return this->mNativeCompilerSetupPage->getCXXCompiler();
695   }
696   if (this->crossCompilerSetup()) {
697     return this->mCrossCompilerSetupPage->getCXXCompiler();
698   }
699   return QString();
700 }
701
702 QString FirstConfigure::getFortranCompiler() const
703 {
704   if (this->compilerSetup()) {
705     return this->mNativeCompilerSetupPage->getFortranCompiler();
706   }
707   if (this->crossCompilerSetup()) {
708     return this->mCrossCompilerSetupPage->getFortranCompiler();
709   }
710   return QString();
711 }
712
713 QString FirstConfigure::getSystemVersion() const
714 {
715   return this->mCrossCompilerSetupPage->getVersion();
716 }
717
718 QString FirstConfigure::getSystemProcessor() const
719 {
720   return this->mCrossCompilerSetupPage->getProcessor();
721 }
722
723 QString FirstConfigure::getCrossRoot() const
724 {
725   return this->mCrossCompilerSetupPage->getFindRoot();
726 }
727
728 const QString CrossModes[] = { "BOTH", "ONLY", "NEVER" };
729
730 QString FirstConfigure::getCrossProgramMode() const
731 {
732   return CrossModes[this->mCrossCompilerSetupPage->getProgramMode()];
733 }
734
735 QString FirstConfigure::getCrossLibraryMode() const
736 {
737   return CrossModes[this->mCrossCompilerSetupPage->getLibraryMode()];
738 }
739
740 QString FirstConfigure::getCrossIncludeMode() const
741 {
742   return CrossModes[this->mCrossCompilerSetupPage->getIncludeMode()];
743 }