cmInstallProgramsCommand.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmInstallProgramsCommand
  18. * \brief Specifies where to install some programs
  19. *
  20. * cmInstallProgramsCommand specifies the relative path where a list of
  21. * programs should be installed.
  22. */
  23. class cmInstallProgramsCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmInstallProgramsCommand;
  32. }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. virtual bool InitialPass(std::vector<std::string> const& args);
  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 "Create UNIX install rules for programs.";
  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. /**
  57. * More documentation.
  58. */
  59. virtual const char* GetFullDocumentation()
  60. {
  61. return
  62. " INSTALL_PROGRAMS(<dir> file file ...)\n"
  63. "Create rules to install the listed programs into the given directory.\n"
  64. " INSTALL_PROGRAMS(<dir> regexp)\n"
  65. "In the second form any program in the current source directory that "
  66. "matches the regular expression will be installed.\n"
  67. "This command is intended to install programs that are not built "
  68. "by cmake, such as shell scripts. See INSTALL_TARGETS to "
  69. "create installation rules for targets built by cmake.\n"
  70. "The directory <dir> is relative to the installation prefix, which "
  71. "is stored in the variable CMAKE_INSTALL_PREFIX.";
  72. }
  73. cmTypeMacro(cmInstallProgramsCommand, cmCommand);
  74. protected:
  75. std::string FindInstallSource(const char* name) const;
  76. private:
  77. std::string m_TargetName;
  78. std::vector<std::string> m_FinalArgs;
  79. };
  80. #endif