Imported Upstream version 3.25.0
[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         // The index is off-by-one due to the first empty item added above.
248         this->PlatformOptions->setCurrentIndex(platform_index + 1);
249       }
250     }
251   } else {
252     PlatformFrame->hide();
253   }
254
255   // Display the toolset box for the generators supporting it
256   if (GeneratorsSupportingToolset.contains(name)) {
257     ToolsetFrame->show();
258   } else {
259     ToolsetFrame->hide();
260   }
261 }
262
263 int StartCompilerSetup::nextId() const
264 {
265   if (compilerSetup()) {
266     return NativeSetup;
267   }
268   if (crossCompilerSetup()) {
269     return CrossSetup;
270   }
271   if (crossCompilerToolChainFile()) {
272     return ToolchainSetup;
273   }
274   return -1;
275 }
276
277 NativeCompilerSetup::NativeCompilerSetup(QWidget* p)
278   : QWizardPage(p)
279 {
280   QVBoxLayout* l = new QVBoxLayout(this);
281   QWidget* c = new QWidget(this);
282   l->addWidget(c);
283   this->setupUi(c);
284 }
285
286 NativeCompilerSetup::~NativeCompilerSetup() = default;
287
288 QString NativeCompilerSetup::getCCompiler() const
289 {
290   return this->CCompiler->text();
291 }
292
293 void NativeCompilerSetup::setCCompiler(const QString& s)
294 {
295   this->CCompiler->setText(s);
296 }
297
298 QString NativeCompilerSetup::getCXXCompiler() const
299 {
300   return this->CXXCompiler->text();
301 }
302
303 void NativeCompilerSetup::setCXXCompiler(const QString& s)
304 {
305   this->CXXCompiler->setText(s);
306 }
307
308 QString NativeCompilerSetup::getFortranCompiler() const
309 {
310   return this->FortranCompiler->text();
311 }
312
313 void NativeCompilerSetup::setFortranCompiler(const QString& s)
314 {
315   this->FortranCompiler->setText(s);
316 }
317
318 CrossCompilerSetup::CrossCompilerSetup(QWidget* p)
319   : QWizardPage(p)
320 {
321   this->setupUi(this);
322   QWidget::setTabOrder(systemName, systemVersion);
323   QWidget::setTabOrder(systemVersion, systemProcessor);
324   QWidget::setTabOrder(systemProcessor, CrossCompilers->CCompiler);
325   QWidget::setTabOrder(CrossCompilers->CCompiler, CrossCompilers->CXXCompiler);
326   QWidget::setTabOrder(CrossCompilers->CXXCompiler,
327                        CrossCompilers->FortranCompiler);
328   QWidget::setTabOrder(CrossCompilers->FortranCompiler, crossFindRoot);
329   QWidget::setTabOrder(crossFindRoot, crossProgramMode);
330   QWidget::setTabOrder(crossProgramMode, crossLibraryMode);
331   QWidget::setTabOrder(crossLibraryMode, crossIncludeMode);
332
333   // fill in combo boxes
334   QStringList modes;
335   modes << tr("Search in Target Root, then native system");
336   modes << tr("Search only in Target Root");
337   modes << tr("Search only in native system");
338   crossProgramMode->addItems(modes);
339   crossLibraryMode->addItems(modes);
340   crossIncludeMode->addItems(modes);
341   crossProgramMode->setCurrentIndex(2);
342   crossLibraryMode->setCurrentIndex(1);
343   crossIncludeMode->setCurrentIndex(1);
344
345   this->registerField("systemName*", this->systemName);
346 }
347
348 CrossCompilerSetup::~CrossCompilerSetup() = default;
349
350 QString CrossCompilerSetup::getCCompiler() const
351 {
352   return this->CrossCompilers->CCompiler->text();
353 }
354
355 void CrossCompilerSetup::setCCompiler(const QString& s)
356 {
357   this->CrossCompilers->CCompiler->setText(s);
358 }
359
360 QString CrossCompilerSetup::getCXXCompiler() const
361 {
362   return this->CrossCompilers->CXXCompiler->text();
363 }
364
365 void CrossCompilerSetup::setCXXCompiler(const QString& s)
366 {
367   this->CrossCompilers->CXXCompiler->setText(s);
368 }
369
370 QString CrossCompilerSetup::getFortranCompiler() const
371 {
372   return this->CrossCompilers->FortranCompiler->text();
373 }
374
375 void CrossCompilerSetup::setFortranCompiler(const QString& s)
376 {
377   this->CrossCompilers->FortranCompiler->setText(s);
378 }
379
380 QString CrossCompilerSetup::getSystem() const
381 {
382   return this->systemName->text();
383 }
384
385 void CrossCompilerSetup::setSystem(const QString& t)
386 {
387   this->systemName->setText(t);
388 }
389
390 QString CrossCompilerSetup::getVersion() const
391 {
392   return this->systemVersion->text();
393 }
394
395 void CrossCompilerSetup::setVersion(const QString& t)
396 {
397   this->systemVersion->setText(t);
398 }
399
400 QString CrossCompilerSetup::getProcessor() const
401 {
402   return this->systemProcessor->text();
403 }
404
405 void CrossCompilerSetup::setProcessor(const QString& t)
406 {
407   this->systemProcessor->setText(t);
408 }
409
410 QString CrossCompilerSetup::getFindRoot() const
411 {
412   return this->crossFindRoot->text();
413 }
414
415 void CrossCompilerSetup::setFindRoot(const QString& t)
416 {
417   this->crossFindRoot->setText(t);
418 }
419
420 int CrossCompilerSetup::getProgramMode() const
421 {
422   return this->crossProgramMode->currentIndex();
423 }
424
425 int CrossCompilerSetup::getLibraryMode() const
426 {
427   return this->crossLibraryMode->currentIndex();
428 }
429
430 int CrossCompilerSetup::getIncludeMode() const
431 {
432   return this->crossIncludeMode->currentIndex();
433 }
434
435 void CrossCompilerSetup::setProgramMode(int m)
436 {
437   this->crossProgramMode->setCurrentIndex(m);
438 }
439
440 void CrossCompilerSetup::setLibraryMode(int m)
441 {
442   this->crossLibraryMode->setCurrentIndex(m);
443 }
444
445 void CrossCompilerSetup::setIncludeMode(int m)
446 {
447   this->crossIncludeMode->setCurrentIndex(m);
448 }
449
450 ToolchainCompilerSetup::ToolchainCompilerSetup(QWidget* p)
451   : QWizardPage(p)
452 {
453   QVBoxLayout* l = new QVBoxLayout(this);
454   l->addWidget(new QLabel(tr("Specify the Toolchain file")));
455   this->ToolchainFile = new QCMakeFilePathEditor(this);
456   l->addWidget(this->ToolchainFile);
457 }
458
459 ToolchainCompilerSetup::~ToolchainCompilerSetup() = default;
460
461 QString ToolchainCompilerSetup::toolchainFile() const
462 {
463   return this->ToolchainFile->text();
464 }
465
466 void ToolchainCompilerSetup::setToolchainFile(const QString& t)
467 {
468   this->ToolchainFile->setText(t);
469 }
470
471 FirstConfigure::FirstConfigure()
472 {
473   const char* env_generator = std::getenv("CMAKE_GENERATOR");
474   const char* env_generator_platform = nullptr;
475   const char* env_generator_toolset = nullptr;
476   if (env_generator && std::strlen(env_generator)) {
477     mDefaultGenerator = env_generator;
478     env_generator_platform = std::getenv("CMAKE_GENERATOR_PLATFORM");
479     env_generator_toolset = std::getenv("CMAKE_GENERATOR_TOOLSET");
480   }
481
482   if (!env_generator_platform) {
483     env_generator_platform = "";
484   }
485
486   if (!env_generator_toolset) {
487     env_generator_toolset = "";
488   }
489
490   // this->setOption(QWizard::HaveFinishButtonOnEarlyPages, true);
491   this->mStartCompilerSetupPage = new StartCompilerSetup(
492     env_generator_platform, env_generator_toolset, this);
493   this->setPage(Start, this->mStartCompilerSetupPage);
494   QObject::connect(this->mStartCompilerSetupPage,
495                    &StartCompilerSetup::selectionChanged, this,
496                    &FirstConfigure::restart);
497   this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
498   this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
499
500   this->mCrossCompilerSetupPage = new CrossCompilerSetup(this);
501   this->setPage(CrossSetup, this->mCrossCompilerSetupPage);
502
503   this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this);
504   this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
505 }
506
507 FirstConfigure::~FirstConfigure() = default;
508
509 void FirstConfigure::setGenerators(
510   std::vector<cmake::GeneratorInfo> const& gens)
511 {
512   this->mStartCompilerSetupPage->setGenerators(gens);
513 }
514
515 void FirstConfigure::setCurrentGenerator(const QString& gen)
516 {
517   this->mStartCompilerSetupPage->setCurrentGenerator(gen);
518 }
519
520 void FirstConfigure::setPlatform(const QString& platform)
521 {
522   this->mStartCompilerSetupPage->setPlatform(platform);
523 }
524
525 void FirstConfigure::setToolset(const QString& toolset)
526 {
527   this->mStartCompilerSetupPage->setToolset(toolset);
528 }
529
530 void FirstConfigure::setCompilerOption(CompilerOption option)
531 {
532   this->mStartCompilerSetupPage->setCompilerOption(option);
533 }
534
535 QString FirstConfigure::getGenerator() const
536 {
537   return this->mStartCompilerSetupPage->getGenerator();
538 }
539
540 QString FirstConfigure::getPlatform() const
541 {
542   return this->mStartCompilerSetupPage->getPlatform();
543 }
544
545 QString FirstConfigure::getToolset() const
546 {
547   return this->mStartCompilerSetupPage->getToolset();
548 }
549
550 void FirstConfigure::loadFromSettings()
551 {
552   QSettings settings;
553   // restore generator
554   settings.beginGroup("Settings/StartPath");
555   QString lastGen = settings.value("LastGenerator").toString();
556   this->setCurrentGenerator(lastGen);
557   settings.endGroup();
558
559   // restore compiler setup
560   settings.beginGroup("Settings/Compiler");
561   this->mNativeCompilerSetupPage->setCCompiler(
562     settings.value("CCompiler").toString());
563   this->mNativeCompilerSetupPage->setCXXCompiler(
564     settings.value("CXXCompiler").toString());
565   this->mNativeCompilerSetupPage->setFortranCompiler(
566     settings.value("FortranCompiler").toString());
567   settings.endGroup();
568
569   // restore cross compiler setup
570   settings.beginGroup("Settings/CrossCompiler");
571   this->mCrossCompilerSetupPage->setCCompiler(
572     settings.value("CCompiler").toString());
573   this->mCrossCompilerSetupPage->setCXXCompiler(
574     settings.value("CXXCompiler").toString());
575   this->mCrossCompilerSetupPage->setFortranCompiler(
576     settings.value("FortranCompiler").toString());
577   this->mToolchainCompilerSetupPage->setToolchainFile(
578     settings.value("ToolChainFile").toString());
579   this->mCrossCompilerSetupPage->setSystem(
580     settings.value("SystemName").toString());
581   this->mCrossCompilerSetupPage->setVersion(
582     settings.value("SystemVersion").toString());
583   this->mCrossCompilerSetupPage->setProcessor(
584     settings.value("SystemProcessor").toString());
585   this->mCrossCompilerSetupPage->setFindRoot(
586     settings.value("FindRoot").toString());
587   this->mCrossCompilerSetupPage->setProgramMode(
588     settings.value("ProgramMode", 0).toInt());
589   this->mCrossCompilerSetupPage->setLibraryMode(
590     settings.value("LibraryMode", 0).toInt());
591   this->mCrossCompilerSetupPage->setIncludeMode(
592     settings.value("IncludeMode", 0).toInt());
593   settings.endGroup();
594
595   // environment variables take precedence over application settings because...
596   // - they're harder to set
597   // - settings always exist after the program is run once, so the environment
598   //     variables would never be used otherwise
599   // - platform and toolset are populated only from environment variables, so
600   //     this prevents them from being taken from environment, while the
601   //     generator is taken from application settings
602   if (!mDefaultGenerator.isEmpty()) {
603     this->setCurrentGenerator(mDefaultGenerator);
604   }
605 }
606
607 void FirstConfigure::saveToSettings()
608 {
609   QSettings settings;
610
611   // save generator
612   settings.beginGroup("Settings/StartPath");
613   QString lastGen = this->mStartCompilerSetupPage->getGenerator();
614   settings.setValue("LastGenerator", lastGen);
615   settings.endGroup();
616
617   // save compiler setup
618   settings.beginGroup("Settings/Compiler");
619   settings.setValue("CCompiler",
620                     this->mNativeCompilerSetupPage->getCCompiler());
621   settings.setValue("CXXCompiler",
622                     this->mNativeCompilerSetupPage->getCXXCompiler());
623   settings.setValue("FortranCompiler",
624                     this->mNativeCompilerSetupPage->getFortranCompiler());
625   settings.endGroup();
626
627   // save cross compiler setup
628   settings.beginGroup("Settings/CrossCompiler");
629   settings.setValue("CCompiler",
630                     this->mCrossCompilerSetupPage->getCCompiler());
631   settings.setValue("CXXCompiler",
632                     this->mCrossCompilerSetupPage->getCXXCompiler());
633   settings.setValue("FortranCompiler",
634                     this->mCrossCompilerSetupPage->getFortranCompiler());
635   settings.setValue("ToolChainFile", this->getCrossCompilerToolChainFile());
636   settings.setValue("SystemName", this->mCrossCompilerSetupPage->getSystem());
637   settings.setValue("SystemVersion",
638                     this->mCrossCompilerSetupPage->getVersion());
639   settings.setValue("SystemProcessor",
640                     this->mCrossCompilerSetupPage->getProcessor());
641   settings.setValue("FindRoot", this->mCrossCompilerSetupPage->getFindRoot());
642   settings.setValue("ProgramMode",
643                     this->mCrossCompilerSetupPage->getProgramMode());
644   settings.setValue("LibraryMode",
645                     this->mCrossCompilerSetupPage->getLibraryMode());
646   settings.setValue("IncludeMode",
647                     this->mCrossCompilerSetupPage->getIncludeMode());
648   settings.endGroup();
649 }
650
651 bool FirstConfigure::defaultSetup() const
652 {
653   return this->mStartCompilerSetupPage->defaultSetup();
654 }
655
656 bool FirstConfigure::compilerSetup() const
657 {
658   return this->mStartCompilerSetupPage->compilerSetup();
659 }
660
661 bool FirstConfigure::crossCompilerSetup() const
662 {
663   return this->mStartCompilerSetupPage->crossCompilerSetup();
664 }
665
666 bool FirstConfigure::crossCompilerToolChainFile() const
667 {
668   return this->mStartCompilerSetupPage->crossCompilerToolChainFile();
669 }
670
671 QString FirstConfigure::getCrossCompilerToolChainFile() const
672 {
673   return this->mToolchainCompilerSetupPage->toolchainFile();
674 }
675
676 QString FirstConfigure::getSystemName() const
677 {
678   return this->mCrossCompilerSetupPage->getSystem();
679 }
680
681 QString FirstConfigure::getCCompiler() const
682 {
683   if (this->compilerSetup()) {
684     return this->mNativeCompilerSetupPage->getCCompiler();
685   }
686   if (this->crossCompilerSetup()) {
687     return this->mCrossCompilerSetupPage->getCCompiler();
688   }
689   return QString();
690 }
691
692 QString FirstConfigure::getCXXCompiler() const
693 {
694   if (this->compilerSetup()) {
695     return this->mNativeCompilerSetupPage->getCXXCompiler();
696   }
697   if (this->crossCompilerSetup()) {
698     return this->mCrossCompilerSetupPage->getCXXCompiler();
699   }
700   return QString();
701 }
702
703 QString FirstConfigure::getFortranCompiler() const
704 {
705   if (this->compilerSetup()) {
706     return this->mNativeCompilerSetupPage->getFortranCompiler();
707   }
708   if (this->crossCompilerSetup()) {
709     return this->mCrossCompilerSetupPage->getFortranCompiler();
710   }
711   return QString();
712 }
713
714 QString FirstConfigure::getSystemVersion() const
715 {
716   return this->mCrossCompilerSetupPage->getVersion();
717 }
718
719 QString FirstConfigure::getSystemProcessor() const
720 {
721   return this->mCrossCompilerSetupPage->getProcessor();
722 }
723
724 QString FirstConfigure::getCrossRoot() const
725 {
726   return this->mCrossCompilerSetupPage->getFindRoot();
727 }
728
729 const QString CrossModes[] = { "BOTH", "ONLY", "NEVER" };
730
731 QString FirstConfigure::getCrossProgramMode() const
732 {
733   return CrossModes[this->mCrossCompilerSetupPage->getProgramMode()];
734 }
735
736 QString FirstConfigure::getCrossLibraryMode() const
737 {
738   return CrossModes[this->mCrossCompilerSetupPage->getLibraryMode()];
739 }
740
741 QString FirstConfigure::getCrossIncludeMode() const
742 {
743   return CrossModes[this->mCrossCompilerSetupPage->getIncludeMode()];
744 }