cmCableWrapTclCommand.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 cmCableWrapTclCommand_h
  14. #define cmCableWrapTclCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. #include "cmCableClassSet.h"
  18. class cmMakeDepend;
  19. /** \class cmCableWrapTclCommand
  20. * \brief Define a command that wraps a set of classes in Tcl.
  21. */
  22. class cmCableWrapTclCommand : public cmCommand
  23. {
  24. public:
  25. cmCableWrapTclCommand();
  26. virtual ~cmCableWrapTclCommand();
  27. /**
  28. * This is a virtual constructor for the command.
  29. */
  30. virtual cmCommand* Clone()
  31. {
  32. return new cmCableWrapTclCommand;
  33. }
  34. /**
  35. * This is called when the command is first encountered in
  36. * the CMakeLists.txt file.
  37. */
  38. virtual bool InitialPass(std::vector<std::string> const& args);
  39. /**
  40. * The name of the command as specified in CMakeList.txt.
  41. */
  42. virtual const char* GetName() { return "CABLE_WRAP_TCL";}
  43. /**
  44. * Succinct documentation.
  45. */
  46. virtual const char* GetTerseDocumentation()
  47. {
  48. return "Wrap a set of classes in Tcl.";
  49. }
  50. /**
  51. * More documentation.
  52. */
  53. virtual const char* GetFullDocumentation()
  54. {
  55. return
  56. "CABLE_WRAP_TCL(target class1 class2 ...)\n"
  57. "Wrap the given set of classes in Tcl using the CABLE tool. The set\n"
  58. "of source files produced for the given package name will be added to\n"
  59. "a source list with the given name.";
  60. }
  61. cmTypeMacro(cmCableWrapTclCommand, cmCommand);
  62. protected:
  63. void GenerateCableFiles() const;
  64. void GenerateCableClassFiles(const char*, const cmCableClass&, const char*) const;
  65. std::string GetGccXmlFromCache() const;
  66. std::string GetGccXmlFlagsFromCache() const;
  67. std::string GetCableFromCache() const;
  68. void AddGccXmlFlagsFromCache(std::vector<std::string>&) const;
  69. class cmGccXmlFlagsParser;
  70. private:
  71. /**
  72. * The name of the package of wrappers to produce.
  73. */
  74. std::string m_TargetName;
  75. /**
  76. * The name of the source list into which the files needed for the package
  77. * will be placed.
  78. */
  79. std::string m_SourceListName;
  80. /**
  81. * The set of classes to be wrapped in the package. This is also implicitly
  82. * added to the makefile as another set.
  83. */
  84. cmCableClassSet* m_CableClassSet;
  85. ///! The dependency generator.
  86. cmMakeDepend* m_MakeDepend;
  87. };
  88. #endif