cmInstallCommandArguments.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 cmInstallCommandArguments_h
  4. #define cmInstallCommandArguments_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmCommandArgumentsHelper.h"
  9. class cmInstallCommandArguments
  10. {
  11. public:
  12. cmInstallCommandArguments(const std::string& defaultComponent);
  13. void SetGenericArguments(cmInstallCommandArguments* args)
  14. {
  15. this->GenericArguments = args;
  16. }
  17. void Parse(const std::vector<std::string>* args,
  18. std::vector<std::string>* unconsumedArgs);
  19. // Compute destination path.and check permissions
  20. bool Finalize();
  21. const std::string& GetDestination() const;
  22. const std::string& GetComponent() const;
  23. bool GetExcludeFromAll() const;
  24. const std::string& GetRename() const;
  25. const std::string& GetPermissions() const;
  26. const std::vector<std::string>& GetConfigurations() const;
  27. bool GetOptional() const;
  28. bool GetNamelinkOnly() const;
  29. bool GetNamelinkSkip() const;
  30. // once HandleDirectoryMode() is also switched to using
  31. // cmInstallCommandArguments then these two functions can become non-static
  32. // private member functions without arguments
  33. static bool CheckPermissions(const std::string& onePerm, std::string& perm);
  34. cmCommandArgumentsHelper Parser;
  35. cmCommandArgumentGroup ArgumentGroup;
  36. private:
  37. cmInstallCommandArguments(); // disabled
  38. cmCAString Destination;
  39. cmCAString Component;
  40. cmCAEnabler ExcludeFromAll;
  41. cmCAString Rename;
  42. cmCAStringVector Permissions;
  43. cmCAStringVector Configurations;
  44. cmCAEnabler Optional;
  45. cmCAEnabler NamelinkOnly;
  46. cmCAEnabler NamelinkSkip;
  47. std::string DestinationString;
  48. std::string PermissionsString;
  49. cmInstallCommandArguments* GenericArguments;
  50. static const char* PermissionsTable[];
  51. static const std::string EmptyString;
  52. std::string DefaultComponentName;
  53. bool CheckPermissions();
  54. };
  55. class cmInstallCommandIncludesArgument
  56. {
  57. public:
  58. cmInstallCommandIncludesArgument();
  59. void Parse(const std::vector<std::string>* args,
  60. std::vector<std::string>* unconsumedArgs);
  61. const std::vector<std::string>& GetIncludeDirs() const;
  62. private:
  63. std::vector<std::string> IncludeDirs;
  64. };
  65. #endif