cmQtAutoGen.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmQtAutoGen_h
  4. #define cmQtAutoGen_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. /** \class cmQtAutoGen
  9. * \brief Class used as namespace for QtAutogen related types and functions
  10. */
  11. class cmQtAutoGen
  12. {
  13. public:
  14. static std::string const listSep;
  15. enum Generator
  16. {
  17. GEN, // General
  18. MOC,
  19. UIC,
  20. RCC
  21. };
  22. enum MultiConfig
  23. {
  24. SINGLE, // Single configuration
  25. WRAP, // Multi configuration using wrapper files
  26. FULL // Full multi configuration using per config sources
  27. };
  28. public:
  29. /// @brief Returns the generator name
  30. static std::string const& GeneratorName(Generator genType);
  31. /// @brief Returns the generator name in upper case
  32. static std::string GeneratorNameUpper(Generator genType);
  33. /// @brief Returns the multi configuration name string
  34. static std::string const& MultiConfigName(MultiConfig config);
  35. /// @brief Returns the multi configuration type
  36. static MultiConfig MultiConfigType(std::string const& name);
  37. /// @brief Returns a the string escaped and enclosed in quotes
  38. static std::string Quoted(std::string const& text);
  39. /// @brief Appends the suffix to the filename before the last dot
  40. static std::string AppendFilenameSuffix(std::string const& filename,
  41. std::string const& suffix);
  42. /// @brief Merges newOpts into baseOpts
  43. static void UicMergeOptions(std::vector<std::string>& baseOpts,
  44. std::vector<std::string> const& newOpts,
  45. bool isQt5);
  46. /// @brief Merges newOpts into baseOpts
  47. static void RccMergeOptions(std::vector<std::string>& baseOpts,
  48. std::vector<std::string> const& newOpts,
  49. bool isQt5);
  50. /// @brief Reads the resource files list from from a .qrc file
  51. /// @arg fileName Must be the absolute path of the .qrc file
  52. /// @return True if the rcc file was successfully parsed
  53. static bool RccListInputs(std::string const& qtMajorVersion,
  54. std::string const& rccCommand,
  55. std::string const& fileName,
  56. std::vector<std::string>& files,
  57. std::string* errorMessage = nullptr);
  58. };
  59. #endif