cmQtAutomoc.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2004-2011 Kitware, Inc.
  4. Copyright 2011 Alexander Neundorf ([email protected])
  5. Distributed under the OSI-approved BSD License (the "License");
  6. see accompanying file Copyright.txt for details.
  7. This software is distributed WITHOUT ANY WARRANTY; without even the
  8. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. See the License for more information.
  10. ============================================================================*/
  11. #ifndef cmQtAutomoc_h
  12. #define cmQtAutomoc_h
  13. class cmGlobalGenerator;
  14. class cmMakefile;
  15. class cmQtAutomoc
  16. {
  17. public:
  18. cmQtAutomoc();
  19. bool Run(const char* targetDirectory);
  20. void SetupAutomocTarget(cmTarget* target);
  21. private:
  22. cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
  23. const char* targetDirectory);
  24. bool ReadAutomocInfoFile(cmMakefile* makefile,
  25. const char* targetDirectory);
  26. bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
  27. const char* targetDirectory);
  28. void WriteOldMocDefinitionsFile(const char* targetDirectory);
  29. bool RunAutomoc();
  30. bool GenerateMoc(const std::string& sourceFile,
  31. const std::string& mocFileName);
  32. void ParseCppFile(const std::string& absFilename,
  33. const std::list<std::string>& headerExtensions,
  34. std::map<std::string, std::string>& includedMocs);
  35. void StrictParseCppFile(const std::string& absFilename,
  36. const std::list<std::string>& headerExtensions,
  37. std::map<std::string, std::string>& includedMocs);
  38. void SearchHeadersForCppFile(const std::string& absFilename,
  39. const std::list<std::string>& headerExtensions,
  40. std::set<std::string>& absHeaders);
  41. void ParseHeaders(const std::set<std::string>& absHeaders,
  42. const std::map<std::string, std::string>& includedMocs,
  43. std::map<std::string, std::string>& notIncludedMocs);
  44. void Init();
  45. std::string Join(const std::list<std::string>& lst, char separator);
  46. bool EndsWith(const std::string& str, const std::string& with);
  47. bool StartsWith(const std::string& str, const std::string& with);
  48. std::string ReadAll(const std::string& filename);
  49. std::string QtMajorVersion;
  50. std::string Sources;
  51. std::string Headers;
  52. bool IncludeProjectDirsBefore;
  53. std::string Srcdir;
  54. std::string Builddir;
  55. std::string MocExecutable;
  56. std::string MocCompileDefinitionsStr;
  57. std::string MocDefinitionsStr;
  58. std::string MocIncludesStr;
  59. std::string MocOptionsStr;
  60. std::string ProjectBinaryDir;
  61. std::string ProjectSourceDir;
  62. std::string TargetName;
  63. std::string OldMocDefinitionsStr;
  64. std::string OutMocCppFilename;
  65. std::list<std::string> MocIncludes;
  66. std::list<std::string> MocDefinitions;
  67. std::vector<std::string> MocOptions;
  68. bool Verbose;
  69. bool ColorOutput;
  70. bool RunMocFailed;
  71. bool GenerateAll;
  72. bool RelaxedMode;
  73. };
  74. #endif