cmQtAutoGen.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 const std::string listSep;
  15. enum GeneratorType
  16. {
  17. GEN, // General
  18. MOC,
  19. UIC,
  20. RCC
  21. };
  22. public:
  23. /// @brief Returns the generator name
  24. static const std::string& GeneratorName(GeneratorType genType);
  25. /// @brief Returns the generator name in upper case
  26. static std::string GeneratorNameUpper(GeneratorType genType);
  27. /// @brief Returns a the string escaped and enclosed in quotes
  28. ///
  29. static std::string Quoted(const std::string& text);
  30. /// @brief Merges newOpts into baseOpts
  31. static void UicMergeOptions(std::vector<std::string>& baseOpts,
  32. const std::vector<std::string>& newOpts,
  33. bool isQt5);
  34. /// @brief Merges newOpts into baseOpts
  35. static void RccMergeOptions(std::vector<std::string>& baseOpts,
  36. const std::vector<std::string>& newOpts,
  37. bool isQt5);
  38. /// @brief Reads the resource files list from from a .qrc file
  39. /// @arg fileName Must be the absolute path of the .qrc file
  40. /// @return True if the rcc file was successfully parsed
  41. static bool RccListInputs(const std::string& qtMajorVersion,
  42. const std::string& rccCommand,
  43. const std::string& fileName,
  44. std::vector<std::string>& files,
  45. std::string* errorMessage = nullptr);
  46. };
  47. #endif