FirstConfigure.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #ifndef FirstConfigure_h
  2. #define FirstConfigure_h
  3. #include <QWizard>
  4. #include <QWizardPage>
  5. #include "ui_Compilers.h"
  6. #include "ui_CrossCompiler.h"
  7. class QRadioButton;
  8. class QComboBox;
  9. //! the wizard pages we'll use for the first configure of a build
  10. enum FirstConfigurePages
  11. {
  12. Start,
  13. NativeSetup,
  14. ToolchainSetup,
  15. CrossSetup,
  16. Done
  17. };
  18. //! the first page that gives basic options for what compilers setup to choose from
  19. class StartCompilerSetup : public QWizardPage
  20. {
  21. Q_OBJECT
  22. public:
  23. StartCompilerSetup(QWidget* p);
  24. ~StartCompilerSetup();
  25. void setGenerators(const QStringList& gens);
  26. void setCurrentGenerator(const QString& gen);
  27. QString getGenerator() const;
  28. bool defaultSetup() const;
  29. bool compilerSetup() const;
  30. bool crossCompilerSetup() const;
  31. bool crossCompilerToolChainFile() const;
  32. int nextId() const;
  33. signals:
  34. void selectionChanged();
  35. protected slots:
  36. void onSelectionChanged(bool);
  37. protected:
  38. QComboBox* GeneratorOptions;
  39. QRadioButton* CompilerSetupOptions[4];
  40. };
  41. //! the page that gives basic options for native compilers
  42. class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
  43. {
  44. Q_OBJECT
  45. public:
  46. NativeCompilerSetup(QWidget* p);
  47. ~NativeCompilerSetup();
  48. QString getCCompiler() const;
  49. void setCCompiler(const QString&);
  50. QString getCXXCompiler() const;
  51. void setCXXCompiler(const QString&);
  52. QString getFortranCompiler() const;
  53. void setFortranCompiler(const QString&);
  54. int nextId() const { return -1; }
  55. };
  56. //! the page that gives options for cross compilers
  57. class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
  58. {
  59. Q_OBJECT
  60. public:
  61. CrossCompilerSetup(QWidget* p);
  62. ~CrossCompilerSetup();
  63. QString getSystem() const;
  64. void setSystem(const QString&);
  65. QString getVersion() const;
  66. void setVersion(const QString&);
  67. QString getProcessor() const;
  68. void setProcessor(const QString&);
  69. QString getCCompiler() const;
  70. void setCCompiler(const QString&);
  71. QString getCXXCompiler() const;
  72. void setCXXCompiler(const QString&);
  73. QString getFortranCompiler() const;
  74. void setFortranCompiler(const QString&);
  75. QString getFindRoot() const;
  76. void setFindRoot(const QString&);
  77. enum CrossMode
  78. {
  79. BOTH,
  80. ONLY,
  81. NEVER
  82. };
  83. int getProgramMode() const;
  84. void setProgramMode(int);
  85. int getLibraryMode() const;
  86. void setLibraryMode(int);
  87. int getIncludeMode() const;
  88. void setIncludeMode(int);
  89. int nextId() const { return -1; }
  90. };
  91. //! the page that gives options for a toolchain file
  92. class ToolchainCompilerSetup : public QWizardPage
  93. {
  94. Q_OBJECT
  95. public:
  96. ToolchainCompilerSetup(QWidget* p);
  97. ~ToolchainCompilerSetup();
  98. QString toolchainFile() const;
  99. void setToolchainFile(const QString&);
  100. int nextId() const { return -1; }
  101. protected:
  102. QCMakeFilePathEditor* ToolchainFile;
  103. };
  104. //! the wizard with the pages
  105. class FirstConfigure : public QWizard
  106. {
  107. Q_OBJECT
  108. public:
  109. FirstConfigure();
  110. ~FirstConfigure();
  111. void setGenerators(const QStringList& gens);
  112. QString getGenerator() const;
  113. bool defaultSetup() const;
  114. bool compilerSetup() const;
  115. bool crossCompilerSetup() const;
  116. bool crossCompilerToolChainFile() const;
  117. QString getCCompiler() const;
  118. QString getCXXCompiler() const;
  119. QString getFortranCompiler() const;
  120. QString getSystemName() const;
  121. QString getSystemVersion() const;
  122. QString getSystemProcessor() const;
  123. QString getCrossRoot() const;
  124. QString getCrossProgramMode() const;
  125. QString getCrossLibraryMode() const;
  126. QString getCrossIncludeMode() const;
  127. QString getCrossCompilerToolChainFile() const;
  128. void loadFromSettings();
  129. void saveToSettings();
  130. protected:
  131. StartCompilerSetup* mStartCompilerSetupPage;
  132. NativeCompilerSetup* mNativeCompilerSetupPage;
  133. CrossCompilerSetup* mCrossCompilerSetupPage;
  134. ToolchainCompilerSetup* mToolchainCompilerSetupPage;
  135. };
  136. #endif // FirstConfigure_h