cmFileInstaller.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <vector>
  7. #include "cmFileCopier.h"
  8. #include "cmInstallMode.h"
  9. #include "cmInstallType.h"
  10. class cmExecutionStatus;
  11. struct cmFileInstaller : public cmFileCopier
  12. {
  13. cmFileInstaller(cmExecutionStatus& status);
  14. ~cmFileInstaller() override;
  15. protected:
  16. cmInstallType InstallType;
  17. cmInstallMode InstallMode;
  18. bool Optional;
  19. bool MessageAlways;
  20. bool MessageLazy;
  21. bool MessageNever;
  22. int DestDirLength;
  23. std::string Rename;
  24. std::string Manifest;
  25. void ManifestAppend(std::string const& file);
  26. std::string const& ToName(std::string const& fromName) override;
  27. void ReportCopy(const std::string& toFile, Type type, bool copy) override;
  28. bool ReportMissing(const std::string& fromFile) override;
  29. bool Install(const std::string& fromFile,
  30. const std::string& toFile) override;
  31. bool InstallFile(const std::string& fromFile, const std::string& toFile,
  32. MatchProperties match_properties) override;
  33. bool Parse(std::vector<std::string> const& args) override;
  34. enum
  35. {
  36. DoingType = DoingLast1,
  37. DoingRename,
  38. DoingLast2
  39. };
  40. bool CheckKeyword(std::string const& arg) override;
  41. bool CheckValue(std::string const& arg) override;
  42. void DefaultFilePermissions() override;
  43. bool GetTargetTypeFromString(const std::string& stype);
  44. bool HandleInstallDestination();
  45. };