cmCablePackageCommand.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 target)\n"
  64. "Close current package (if any), and open a new package definition.";
  65. }
  66. void WritePackageHeader() const;
  67. void WritePackageFooter() const;
  68. const char *GetPackageName() {return m_PackageName.c_str();}
  69. cmTypeMacro(cmCablePackageCommand, cmCableCommand);
  70. private:
  71. /**
  72. * The name of the package.
  73. */
  74. std::string m_PackageName;
  75. std::string m_TargetName;
  76. };
  77. #endif