cmCableCloseNamespaceCommand.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 cmCableCloseNamespaceCommand_h
  12. #define cmCableCloseNamespaceCommand_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmCableCommand.h"
  15. /** \class cmCableCloseNamespaceCommand
  16. * \brief Define a command that closes a CABLE Namespace.
  17. *
  18. * cmCableCloseNamespaceCommand is used to generate CABLE Namespace
  19. * close tags in the configuration file.
  20. */
  21. class cmCableCloseNamespaceCommand : public cmCableCommand
  22. {
  23. public:
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmCableCloseNamespaceCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool Invoke(std::vector<std::string>& args);
  36. /**
  37. * This determines if the command gets propagated down
  38. * to makefiles located in subdirectories.
  39. */
  40. virtual bool IsInherited()
  41. {return true;}
  42. /**
  43. * The name of the command as specified in CMakeList.txt.
  44. */
  45. virtual const char* GetName() { return "CABLE_CLOSE_NAMESPACE";}
  46. /**
  47. * Succinct documentation.
  48. */
  49. virtual const char* GetTerseDocumentation()
  50. {
  51. return "Close a CABLE Namespace";
  52. }
  53. /**
  54. * More documentation.
  55. */
  56. virtual const char* GetFullDocumentation()
  57. {
  58. return
  59. "CABLE_CLOSE_NAMESPACE(namespace_name)\n"
  60. "Close the given namespace in the generated configuration file.\n"
  61. "There must be a matching CABLE_OPEN_NAMESPACE(namespace_name)\n"
  62. "called with the same name.";
  63. }
  64. cmTypeMacro(cmCableCloseNamespaceCommand, cmCableCommand);
  65. private:
  66. void WriteNamespaceFooter() const;
  67. private:
  68. /**
  69. * The name of the namespace to setup.
  70. */
  71. std::string m_NamespaceName;
  72. };
  73. #endif