cmInstallCommandArguments.h 2.2 KB

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