cmQTWrapCPPCommand.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #include "cmSourceFile.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
  21. * normal C++
  22. */
  23. class cmQTWrapCPPCommand : public cmCommand
  24. {
  25. public:
  26. cmTypeMacro(cmQTWrapCPPCommand, cmCommand);
  27. /**
  28. * This is a virtual constructor for the command.
  29. */
  30. virtual cmCommand* Clone()
  31. {
  32. return new cmQTWrapCPPCommand;
  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. * This is called at the end after all the information
  41. * specified by the command is accumulated. Most commands do
  42. * not implement this method. At this point, reading and
  43. * writing to the cache can be done.
  44. */
  45. virtual void FinalPass();
  46. /**
  47. * The name of the command as specified in CMakeList.txt.
  48. */
  49. virtual const char* GetName() { return "QT_WRAP_CPP";}
  50. /**
  51. * Succinct documentation.
  52. */
  53. virtual const char* GetTerseDocumentation()
  54. {
  55. return "Create QT Wrappers.";
  56. }
  57. /**
  58. * More documentation.
  59. */
  60. virtual const char* GetFullDocumentation()
  61. {
  62. return
  63. " QT_WRAP_CPP(resultingLibraryName DestName\n"
  64. " SourceLists ...)\n"
  65. "Produce moc files for all the .h files listed in the SourceLists. "
  66. "The moc files will be added to the library using the DestName "
  67. "source list.";
  68. }
  69. private:
  70. /**
  71. * List of produced files.
  72. */
  73. std::vector<cmSourceFile> WrapClasses;
  74. /**
  75. * List of header files that pprovide the source for WrapClasses.
  76. */
  77. std::vector<std::string> WrapHeaders;
  78. std::string LibraryName;
  79. std::string SourceList;
  80. };
  81. #endif