cmInstallProgramsCommand.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 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(path file file ...)\n"
  63. "INSTALL_PROGRAMS(path regexp)\n"
  64. "Create rules to install the listed programs into the path. Path is relative to the variable CMAKE_INSTALL_PREFIX. There are two forms for this command. In the first the programs can be specified explicitly. In the second form any program in the current directory that match the regular expression will be installed.";
  65. }
  66. cmTypeMacro(cmInstallProgramsCommand, cmCommand);
  67. protected:
  68. std::string FindInstallSource(const char* name) const;
  69. private:
  70. std::string m_TargetName;
  71. std::vector<std::string> m_FinalArgs;
  72. };
  73. #endif