cmInstallFilesCommand.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 cmInstallFilesCommand_h
  4. #define cmInstallFilesCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cm_memory.hxx"
  9. #include "cmCommand.h"
  10. class cmExecutionStatus;
  11. /** \class cmInstallFilesCommand
  12. * \brief Specifies where to install some files
  13. *
  14. * cmInstallFilesCommand specifies the relative path where a list of
  15. * files should be installed.
  16. */
  17. class cmInstallFilesCommand : public cmCommand
  18. {
  19. public:
  20. /**
  21. * This is a virtual constructor for the command.
  22. */
  23. std::unique_ptr<cmCommand> Clone() override
  24. {
  25. return cm::make_unique<cmInstallFilesCommand>();
  26. }
  27. /**
  28. * This is called when the command is first encountered in
  29. * the CMakeLists.txt file.
  30. */
  31. bool InitialPass(std::vector<std::string> const& args,
  32. cmExecutionStatus& status) override;
  33. /**
  34. * This is called at the end after all the information
  35. * specified by the command is accumulated. Most commands do
  36. * not implement this method. At this point, reading and
  37. * writing to the cache can be done.
  38. */
  39. void FinalPass() override;
  40. bool HasFinalPass() const override { return !this->IsFilesForm; }
  41. protected:
  42. void CreateInstallGenerator() const;
  43. std::string FindInstallSource(const char* name) const;
  44. private:
  45. std::vector<std::string> FinalArgs;
  46. bool IsFilesForm = false;
  47. std::string Destination;
  48. std::vector<std::string> Files;
  49. };
  50. #endif