cmInstallProgramsCommand.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 "Create UNIX install rules for programs.";
  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. " INSTALL_PROGRAMS(<dir> file file ...)\n"
  62. "Create rules to install the listed programs into the given directory.\n"
  63. " INSTALL_PROGRAMS(<dir> regexp)\n"
  64. "In the second form any program in the current source directory that "
  65. "matches the regular expression will be installed.\n"
  66. "This command is intended to install programs that are not built "
  67. "by cmake, such as shell scripts. See INSTALL_TARGETS to "
  68. "create installation rules for targets built by cmake.\n"
  69. "The directory <dir> is relative to the installation prefix, which "
  70. "is stored in the variable CMAKE_INSTALL_PREFIX.";
  71. }
  72. cmTypeMacro(cmInstallProgramsCommand, cmCommand);
  73. protected:
  74. std::string FindInstallSource(const char* name) const;
  75. private:
  76. std::string m_TargetName;
  77. std::vector<std::string> m_FinalArgs;
  78. };
  79. #endif