cmInstallFilesCommand.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 cmInstallFilesCommand_h
  14. #define cmInstallFilesCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmInstallFilesCommand
  17. * \brief Specifies where to install some files
  18. *
  19. * cmInstallFilesCommand specifies the relative path where a list of
  20. * files should be installed.
  21. */
  22. class cmInstallFilesCommand : public cmCommand
  23. {
  24. public:
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. return new cmInstallFilesCommand;
  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_FILES";}
  41. /**
  42. * Succinct documentation.
  43. */
  44. virtual const char* GetTerseDocumentation()
  45. {
  46. return "Create UNIX install rules for files.";
  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_FILES(<dir> extension file file ...)\n"
  62. "Create rules to install the listed files with the given extension "
  63. "into the given directory. "
  64. "Only files existing in the current source tree or its corresponding "
  65. "location in the binary tree may be listed. "
  66. "If a file specified already has an extension, that extension will be "
  67. "removed first. This is useful for providing lists of source files such "
  68. "as foo.cxx when you want the corresponding foo.h to be installed. A"
  69. "typical extension is '.h'.\n"
  70. " INSTALL_FILES(<dir> regexp)\n"
  71. "Any files in the current source directory that match the regular "
  72. "expression will be installed.\n"
  73. " INSTALL_FILES(<dir> FILES file file ...)\n"
  74. "Any files listed after the FILES keyword will be "
  75. "installed explicitly from the names given. Full paths are allowed in "
  76. "this form.\n"
  77. "The directory <dir> is relative to the installation prefix, which "
  78. "is stored in the variable CMAKE_INSTALL_PREFIX.";
  79. }
  80. cmTypeMacro(cmInstallFilesCommand, cmCommand);
  81. protected:
  82. std::string FindInstallSource(const char* name) const;
  83. private:
  84. std::string m_TargetName;
  85. std::vector<std::string> m_FinalArgs;
  86. bool m_IsFilesForm;
  87. };
  88. #endif