cmInstallFilesCommand.h 1.5 KB

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