cmQTWrapCPPCommand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 "cmCommand.h"
  16. /** \class cmQTWrapCPPCommand
  17. * \brief Create moc file rules for QT classes
  18. *
  19. * cmQTWrapCPPCommand is used to create wrappers for QT classes into normal C++
  20. */
  21. class cmQTWrapCPPCommand : public cmCommand
  22. {
  23. public:
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmQTWrapCPPCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args);
  36. /**
  37. * This is called at the end after all the information
  38. * specified by the command is accumulated. Most commands do
  39. * not implement this method. At this point, reading and
  40. * writing to the cache can be done.
  41. */
  42. virtual void FinalPass();
  43. /**
  44. * The name of the command as specified in CMakeList.txt.
  45. */
  46. virtual const char* GetName() { return "QT_WRAP_CPP";}
  47. /**
  48. * Succinct documentation.
  49. */
  50. virtual const char* GetTerseDocumentation()
  51. {
  52. return "Create QT Wrappers.";
  53. }
  54. /**
  55. * More documentation.
  56. */
  57. virtual const char* GetFullDocumentation()
  58. {
  59. return
  60. " QT_WRAP_CPP(resultingLibraryName DestName\n"
  61. " SourceLists ...)\n"
  62. "Produce moc files for all the .h file listed in the SourceLists. "
  63. "The moc files will be added to the library using the DestName "
  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