cmQTWrapCPPCommand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 cmQTWrapCPPCommand_h
  14. #define cmQTWrapCPPCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmQTWrapCPPCommand
  18. * \brief Create moc file rules for QT classes
  19. *
  20. * cmQTWrapCPPCommand is used to create wrappers for QT classes into normal C++
  21. */
  22. class cmQTWrapCPPCommand : public cmCommand
  23. {
  24. public:
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. return new cmQTWrapCPPCommand;
  31. }
  32. /**
  33. * This is called when the command is first encountered in
  34. * the CMakeLists.txt file.
  35. */
  36. virtual bool InitialPass(std::vector<std::string> const& args);
  37. /**
  38. * This is called at the end after all the information
  39. * specified by the command is accumulated. Most commands do
  40. * not implement this method. At this point, reading and
  41. * writing to the cache can be done.
  42. */
  43. virtual void FinalPass();
  44. /**
  45. * The name of the command as specified in CMakeList.txt.
  46. */
  47. virtual const char* GetName() { return "QT_WRAP_CPP";}
  48. /**
  49. * Succinct documentation.
  50. */
  51. virtual const char* GetTerseDocumentation()
  52. {
  53. return "Create QT Wrappers.";
  54. }
  55. /**
  56. * More documentation.
  57. */
  58. virtual const char* GetFullDocumentation()
  59. {
  60. return
  61. "QT_WRAP_CPP(resultingLibraryName DestName SourceLists ...)\n"
  62. "Produce moc files for all the .h file listed in the SourceLists.\n"
  63. "The moc files will be added to the library using the DestName\n"
  64. "source list.";
  65. }
  66. private:
  67. /**
  68. * List of produced files.
  69. */
  70. std::vector<cmSourceFile> m_WrapClasses;
  71. /**
  72. * List of header files that pprovide the source for m_WrapClasses.
  73. */
  74. std::vector<std::string> m_WrapHeaders;
  75. std::string m_LibraryName;
  76. std::string m_SourceList;
  77. };
  78. #endif