cmInstallCommandArguments.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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(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. const std::string& GetNamelinkComponent() const;
  24. bool GetExcludeFromAll() const;
  25. const std::string& GetRename() const;
  26. const std::string& GetPermissions() const;
  27. const std::vector<std::string>& GetConfigurations() const;
  28. bool GetOptional() const;
  29. bool GetNamelinkOnly() const;
  30. bool GetNamelinkSkip() const;
  31. bool HasNamelinkComponent() const;
  32. const std::string& GetType() const;
  33. // once HandleDirectoryMode() is also switched to using
  34. // cmInstallCommandArguments then these two functions can become non-static
  35. // private member functions without arguments
  36. static bool CheckPermissions(const std::string& onePerm, std::string& perm);
  37. cmCommandArgumentsHelper Parser;
  38. cmCommandArgumentGroup ArgumentGroup;
  39. private:
  40. cmInstallCommandArguments(); // disabled
  41. cmCAString Destination;
  42. cmCAString Component;
  43. cmCAString NamelinkComponent;
  44. cmCAEnabler ExcludeFromAll;
  45. cmCAString Rename;
  46. cmCAStringVector Permissions;
  47. cmCAStringVector Configurations;
  48. cmCAEnabler Optional;
  49. cmCAEnabler NamelinkOnly;
  50. cmCAEnabler NamelinkSkip;
  51. cmCAString Type;
  52. std::string DestinationString;
  53. std::string PermissionsString;
  54. cmInstallCommandArguments* GenericArguments;
  55. static const char* PermissionsTable[];
  56. static const std::string EmptyString;
  57. std::string DefaultComponentName;
  58. bool CheckPermissions();
  59. };
  60. class cmInstallCommandIncludesArgument
  61. {
  62. public:
  63. cmInstallCommandIncludesArgument();
  64. void Parse(const std::vector<std::string>* args,
  65. std::vector<std::string>* unconsumedArgs);
  66. const std::vector<std::string>& GetIncludeDirs() const;
  67. private:
  68. std::vector<std::string> IncludeDirs;
  69. };
  70. #endif