cmInstallProgramsCommand.h 1.6 KB

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