FirstConfigure.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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 : public QWizardPage, protected Ui::Compilers
  53. {
  54. Q_OBJECT
  55. public:
  56. NativeCompilerSetup(QWidget* p);
  57. ~NativeCompilerSetup();
  58. QString getCCompiler() const;
  59. void setCCompiler(const QString&);
  60. QString getCXXCompiler() const;
  61. void setCXXCompiler(const QString&);
  62. QString getFortranCompiler() const;
  63. void setFortranCompiler(const QString&);
  64. int nextId() const { return -1; }
  65. };
  66. //! the page that gives options for cross compilers
  67. class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
  68. {
  69. Q_OBJECT
  70. public:
  71. CrossCompilerSetup(QWidget* p);
  72. ~CrossCompilerSetup();
  73. QString getSystem() const;
  74. void setSystem(const QString&);
  75. QString getVersion() const;
  76. void setVersion(const QString&);
  77. QString getProcessor() const;
  78. void setProcessor(const QString&);
  79. QString getCCompiler() const;
  80. void setCCompiler(const QString&);
  81. QString getCXXCompiler() const;
  82. void setCXXCompiler(const QString&);
  83. QString getFortranCompiler() const;
  84. void setFortranCompiler(const QString&);
  85. QString getFindRoot() const;
  86. void setFindRoot(const QString&);
  87. enum CrossMode
  88. {
  89. BOTH,
  90. ONLY,
  91. NEVER
  92. };
  93. int getProgramMode() const;
  94. void setProgramMode(int);
  95. int getLibraryMode() const;
  96. void setLibraryMode(int);
  97. int getIncludeMode() const;
  98. void setIncludeMode(int);
  99. int nextId() const { return -1; }
  100. };
  101. //! the page that gives options for a toolchain file
  102. class ToolchainCompilerSetup : public QWizardPage
  103. {
  104. Q_OBJECT
  105. public:
  106. ToolchainCompilerSetup(QWidget* p);
  107. ~ToolchainCompilerSetup();
  108. QString toolchainFile() const;
  109. void setToolchainFile(const QString&);
  110. int nextId() const { return -1; }
  111. protected:
  112. QCMakeFilePathEditor* ToolchainFile;
  113. };
  114. //! the wizard with the pages
  115. class FirstConfigure : public QWizard
  116. {
  117. Q_OBJECT
  118. public:
  119. FirstConfigure();
  120. ~FirstConfigure();
  121. void setGenerators(std::vector<cmake::GeneratorInfo> const& gens);
  122. QString getGenerator() const;
  123. QString getToolset() const;
  124. bool defaultSetup() const;
  125. bool compilerSetup() const;
  126. bool crossCompilerSetup() const;
  127. bool crossCompilerToolChainFile() const;
  128. QString getCCompiler() const;
  129. QString getCXXCompiler() const;
  130. QString getFortranCompiler() const;
  131. QString getSystemName() const;
  132. QString getSystemVersion() const;
  133. QString getSystemProcessor() const;
  134. QString getCrossRoot() const;
  135. QString getCrossProgramMode() const;
  136. QString getCrossLibraryMode() const;
  137. QString getCrossIncludeMode() const;
  138. QString getCrossCompilerToolChainFile() const;
  139. void loadFromSettings();
  140. void saveToSettings();
  141. protected:
  142. StartCompilerSetup* mStartCompilerSetupPage;
  143. NativeCompilerSetup* mNativeCompilerSetupPage;
  144. CrossCompilerSetup* mCrossCompilerSetupPage;
  145. ToolchainCompilerSetup* mToolchainCompilerSetupPage;
  146. };
  147. #endif // FirstConfigure_h