cmInstallProgramsCommand.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmInstallProgramsCommand_h
  11. #define cmInstallProgramsCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmInstallProgramsCommand
  14. * \brief Specifies where to install some programs
  15. *
  16. * cmInstallProgramsCommand specifies the relative path where a list of
  17. * programs should be installed.
  18. */
  19. class cmInstallProgramsCommand : public cmCommand
  20. {
  21. public:
  22. /**
  23. * This is a virtual constructor for the command.
  24. */
  25. virtual cmCommand* Clone()
  26. {
  27. return new cmInstallProgramsCommand;
  28. }
  29. /**
  30. * This is called when the command is first encountered in
  31. * the CMakeLists.txt file.
  32. */
  33. virtual bool InitialPass(std::vector<std::string> const& args,
  34. cmExecutionStatus &status);
  35. /**
  36. * The name of the command as specified in CMakeList.txt.
  37. */
  38. virtual const char* GetName() { return "install_programs";}
  39. /**
  40. * Succinct documentation.
  41. */
  42. virtual const char* GetTerseDocumentation()
  43. {
  44. return "Deprecated. Use the install(PROGRAMS ) command instead.";
  45. }
  46. /**
  47. * This is called at the end after all the information
  48. * specified by the command is accumulated. Most commands do
  49. * not implement this method. At this point, reading and
  50. * writing to the cache can be done.
  51. */
  52. virtual void FinalPass();
  53. virtual bool HasFinalPass() const { return true; }
  54. /**
  55. * More documentation.
  56. */
  57. virtual const char* GetFullDocumentation()
  58. {
  59. return
  60. "This command has been superceded by the install command. It "
  61. "is provided for compatibility with older CMake code. "
  62. "The FILES form is directly replaced by the PROGRAMS form of the "
  63. "INSTALL command. The regexp form can be expressed more clearly "
  64. "using the GLOB form of the FILE command.\n"
  65. " install_programs(<dir> file1 file2 [file3 ...])\n"
  66. " install_programs(<dir> FILES file1 [file2 ...])\n"
  67. "Create rules to install the listed programs into the given directory. "
  68. "Use the FILES argument to guarantee that the file list version of "
  69. "the command will be used even when there is only one argument.\n"
  70. " install_programs(<dir> regexp)\n"
  71. "In the second form any program in the current source directory that "
  72. "matches the regular expression will be installed.\n"
  73. "This command is intended to install programs that are not built "
  74. "by cmake, such as shell scripts. See the TARGETS form of "
  75. "the INSTALL command to "
  76. "create installation rules for targets built by cmake.\n"
  77. "The directory <dir> is relative to the installation prefix, which "
  78. "is stored in the variable CMAKE_INSTALL_PREFIX.";
  79. }
  80. /** This command is kept for compatibility with older CMake versions. */
  81. virtual bool IsDiscouraged()
  82. {
  83. return true;
  84. }
  85. cmTypeMacro(cmInstallProgramsCommand, cmCommand);
  86. protected:
  87. std::string FindInstallSource(const char* name) const;
  88. private:
  89. std::vector<std::string> FinalArgs;
  90. std::string Destination;
  91. std::vector<std::string> Files;
  92. };
  93. #endif