cmCablePackageCommand.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #ifndef cmCablePackageCommand_h
  12. #define cmCablePackageCommand_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmCableCommand.h"
  15. /** \class cmCablePackageCommand
  16. * \brief Define a command that begins a CABLE Package definition.
  17. *
  18. * cmCablePackageCommand is used to generate a new CABLE Package.
  19. * All subsequent commands that require a package will refer to that
  20. * setup by this command, until another package is started.
  21. */
  22. class cmCablePackageCommand : public cmCableCommand
  23. {
  24. public:
  25. cmCablePackageCommand() {}
  26. virtual ~cmCablePackageCommand() {}
  27. /**
  28. * This is a virtual constructor for the command.
  29. */
  30. virtual cmCommand* Clone()
  31. {
  32. return new cmCablePackageCommand;
  33. }
  34. /**
  35. * This is called when the command is first encountered in
  36. * the CMakeLists.txt file.
  37. */
  38. virtual bool Invoke(std::vector<std::string>& args);
  39. /**
  40. * This is called at the end after all the information
  41. * specified by the command is accumulated. Most commands do
  42. * not implement this method. At this point, reading and
  43. * writing to the cache can be done.
  44. */
  45. virtual void FinalPass();
  46. /**
  47. * The name of the command as specified in CMakeList.txt.
  48. */
  49. virtual const char* GetName() { return "CABLE_PACKAGE";}
  50. /**
  51. * Succinct documentation.
  52. */
  53. virtual const char* GetTerseDocumentation()
  54. {
  55. return "Begin a package definition.";
  56. }
  57. /**
  58. * More documentation.
  59. */
  60. virtual const char* GetFullDocumentation()
  61. {
  62. return
  63. "CABLE_PACKAGE(package_name)\n"
  64. "Close current package (if any), and open a new package definition.";
  65. }
  66. void WritePackageHeader() const;
  67. void WritePackageFooter() const;
  68. cmTypeMacro(cmCablePackageCommand, cmCableCommand);
  69. private:
  70. /**
  71. * The name of the package.
  72. */
  73. std::string m_PackageName;
  74. };
  75. #endif