cmInstallProgramsCommand.h 3.6 KB

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