cmCableDefineSetCommand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 cmCableDefineSetCommand_h
  12. #define cmCableDefineSetCommand_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmCableCommand.h"
  15. /** \class cmCableDefineSetCommand
  16. * \brief Define a command that adds a CABLE Set definition.
  17. *
  18. * cmCableDefineSetCommand is used to define a named CABLE Set.
  19. * The set can be referenced in other CABLE command arguments
  20. * with a '$' followed by the set name.
  21. */
  22. class cmCableDefineSetCommand : public cmCableCommand
  23. {
  24. public:
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. return new cmCableDefineSetCommand;
  31. }
  32. /**
  33. * This is called when the command is first encountered in
  34. * the CMakeLists.txt file.
  35. */
  36. virtual bool Invoke(std::vector<std::string>& args);
  37. /**
  38. * This determines if the command gets propagated down
  39. * to makefiles located in subdirectories.
  40. */
  41. virtual bool IsInherited()
  42. { return true; }
  43. /**
  44. * The name of the command as specified in CMakeList.txt.
  45. */
  46. virtual const char* GetName() { return "CABLE_DEFINE_SET";}
  47. /**
  48. * Succinct documentation.
  49. */
  50. virtual const char* GetTerseDocumentation()
  51. {
  52. return "Define a CABLE Set.";
  53. }
  54. /**
  55. * More documentation.
  56. */
  57. virtual const char* GetFullDocumentation()
  58. {
  59. return
  60. "CABLE_DEFINE_SET(name_of_set member1 member2 ...)\n"
  61. "Generates a Set definition in the CABLE configuration. Tags are\n"
  62. "automatically generated. The sets are referenced in other CABLE\n"
  63. "commands by a '$' immediately followed by the set name (ex. $SetName).";
  64. }
  65. cmTypeMacro(cmCableDefineSetCommand, cmCableCommand);
  66. private:
  67. void WriteConfiguration() const;
  68. std::string GenerateTag(const std::string&) const;
  69. private:
  70. typedef std::pair<std::string, std::string> Element;
  71. typedef std::vector<Element> Elements;
  72. /**
  73. * The name of the set.
  74. */
  75. std::string m_SetName;
  76. /**
  77. * The elements to be defined in the set (before $ expansion).
  78. */
  79. Elements m_Elements;
  80. };
  81. #endif