cmInstallFilesCommand.h 3.2 KB

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