cmInstallCommandArguments.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmInstallCommandArguments_h
  11. #define cmInstallCommandArguments_h
  12. #include "cmStandardIncludes.h"
  13. #include "cmCommandArgumentsHelper.h"
  14. class cmInstallCommandArguments
  15. {
  16. public:
  17. cmInstallCommandArguments(const std::string& defaultComponent);
  18. void SetGenericArguments(cmInstallCommandArguments* args)
  19. {this->GenericArguments = args;}
  20. void Parse(const std::vector<std::string>* args,
  21. std::vector<std::string>* unconsumedArgs);
  22. // Compute destination path.and check permissions
  23. bool Finalize();
  24. const std::string& GetDestination() const;
  25. const std::string& GetComponent() const;
  26. const std::string& GetRename() const;
  27. const std::string& GetPermissions() const;
  28. const std::vector<std::string>& GetConfigurations() const;
  29. bool GetOptional() const;
  30. bool GetNamelinkOnly() const;
  31. bool GetNamelinkSkip() const;
  32. // once HandleDirectoryMode() is also switched to using
  33. // cmInstallCommandArguments then these two functions can become non-static
  34. // private member functions without arguments
  35. static bool CheckPermissions(const std::string& onePerm,
  36. std::string& perm);
  37. cmCommandArgumentsHelper Parser;
  38. cmCommandArgumentGroup ArgumentGroup;
  39. private:
  40. cmInstallCommandArguments(); // disabled
  41. cmCAString Destination;
  42. cmCAString Component;
  43. cmCAString Rename;
  44. cmCAStringVector Permissions;
  45. cmCAStringVector Configurations;
  46. cmCAEnabler Optional;
  47. cmCAEnabler NamelinkOnly;
  48. cmCAEnabler NamelinkSkip;
  49. std::string DestinationString;
  50. std::string PermissionsString;
  51. cmInstallCommandArguments* GenericArguments;
  52. static const char* PermissionsTable[];
  53. static const std::string EmptyString;
  54. bool CheckPermissions();
  55. };
  56. #endif