cmInstallProgramsCommand.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. /**
  38. * The name of the command as specified in CMakeList.txt.
  39. */
  40. virtual const char* GetName() { return "INSTALL_PROGRAMS";}
  41. /**
  42. * Succinct documentation.
  43. */
  44. virtual const char* GetTerseDocumentation()
  45. {
  46. return "Deprecated. Use the INSTALL(PROGRAMS ) command instead.";
  47. }
  48. /**
  49. * This is called at the end after all the information
  50. * specified by the command is accumulated. Most commands do
  51. * not implement this method. At this point, reading and
  52. * writing to the cache can be done.
  53. */
  54. virtual void FinalPass();
  55. /**
  56. * More documentation.
  57. */
  58. virtual const char* GetFullDocumentation()
  59. {
  60. return
  61. "This command has been superceded by the INSTALL command. It "
  62. "is provided for compatibility with older CMake code. "
  63. "The FILES form is directly replaced by the PROGRAMS form of the "
  64. "INSTALL command. The regexp form can be expressed more clearly "
  65. "using the GLOB form of the FILE command.\n"
  66. " INSTALL_PROGRAMS(<dir> file1 file2 [file3 ...])\n"
  67. " INSTALL_PROGRAMS(<dir> FILES file1 [file2 ...])\n"
  68. "Create rules to install the listed programs into the given directory. "
  69. "Use the FILES argument to guarantee that the file list version of "
  70. "the command will be used even when there is only one argument.\n"
  71. " INSTALL_PROGRAMS(<dir> regexp)\n"
  72. "In the second form any program in the current source directory that "
  73. "matches the regular expression will be installed.\n"
  74. "This command is intended to install programs that are not built "
  75. "by cmake, such as shell scripts. See the TARGETS form of "
  76. "the INSTALL command to "
  77. "create installation rules for targets built by cmake.\n"
  78. "The directory <dir> is relative to the installation prefix, which "
  79. "is stored in the variable CMAKE_INSTALL_PREFIX.";
  80. }
  81. /** This command is kept for compatibility with older CMake versions. */
  82. virtual bool IsDiscouraged()
  83. {
  84. return true;
  85. }
  86. cmTypeMacro(cmInstallProgramsCommand, cmCommand);
  87. protected:
  88. std::string FindInstallSource(const char* name) const;
  89. private:
  90. std::string TargetName;
  91. std::vector<std::string> FinalArgs;
  92. };
  93. #endif