FirstConfigure.h 4.1 KB

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