cmFileInstaller.h 1.6 KB

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