cmInstallCommandArguments.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmInstallCommandArguments_h
  14. #define cmInstallCommandArguments_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommandArgumentsHelper.h"
  17. class cmInstallCommandArguments
  18. {
  19. public:
  20. cmInstallCommandArguments();
  21. void SetGenericArguments(cmInstallCommandArguments* args)
  22. {this->GenericArguments = args;}
  23. void Parse(const std::vector<std::string>* args,
  24. std::vector<std::string>* unconsumedArgs);
  25. // Compute destination path.and check permissions
  26. bool Finalize();
  27. const std::string& GetDestination() const;
  28. const std::string& GetComponent() const;
  29. const std::string& GetRename() const;
  30. const std::string& GetPermissions() const;
  31. const std::vector<std::string>& GetConfigurations() const;
  32. bool GetOptional() 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 void ComputeDestination(const std::string& inDest,
  37. std::string& absDest);
  38. static bool CheckPermissions(const std::string& onePerm,
  39. std::string& perm);
  40. cmCommandArgumentsHelper Parser;
  41. cmCommandArgumentGroup ArgumentGroup;
  42. private:
  43. cmCAString Destination;
  44. cmCAString Component;
  45. cmCAString Rename;
  46. cmCAStringVector Permissions;
  47. cmCAStringVector Configurations;
  48. cmCAEnabler Optional;
  49. std::string AbsDestination;
  50. std::string PermissionsString;
  51. cmInstallCommandArguments* GenericArguments;
  52. static const char* PermissionsTable[];
  53. static const std::string EmptyString;
  54. bool CheckPermissions();
  55. };
  56. #endif