cmQtAutomoc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef cmQtAutomoc_h
  2. #define cmQtAutomoc_h
  3. class cmGlobalGenerator;
  4. class cmMakefile;
  5. class cmQtAutomoc
  6. {
  7. public:
  8. cmQtAutomoc();
  9. bool Run(const char* targetDirectory);
  10. void SetupAutomocTarget(cmMakefile* makefile,
  11. const char* targetName,
  12. std::vector<std::string>& srcs);
  13. void AddTargetDependency(cmMakefile* makefile, cmTarget* target);
  14. private:
  15. cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
  16. const char* targetDirectory);
  17. bool ReadAutomocInfoFile(cmMakefile* makefile,
  18. const char* targetDirectory);
  19. bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
  20. const char* targetDirectory);
  21. void WriteOldMocDefinitionsFile(const char* targetDirectory);
  22. bool RunAutomocQt4();
  23. bool GenerateMoc(const std::string& sourceFile,
  24. const std::string& mocFileName);
  25. void ParseCppFile(const std::string& absFilename,
  26. std::map<std::string, std::string>& includedMocs,
  27. std::map<std::string, std::string>& notIncludedMocs);
  28. void Init();
  29. std::string Join(const std::list<std::string>& lst, char separator);
  30. bool EndsWith(const std::string& str, const std::string& with);
  31. bool StartsWith(const std::string& str, const std::string& with);
  32. std::string ReadAll(const std::string& filename);
  33. std::string QtMajorVersion;
  34. std::string Sources;
  35. std::string Headers;
  36. bool IncludeProjectDirsBefore;
  37. std::string Srcdir;
  38. std::string Builddir;
  39. std::string MocExecutable;
  40. std::string MocCompileDefinitionsStr;
  41. std::string MocDefinitionsStr;
  42. std::string MocIncludesStr;
  43. std::string ProjectBinaryDir;
  44. std::string ProjectSourceDir;
  45. std::string TargetName;
  46. std::string OldMocDefinitionsStr;
  47. std::string OutMocCppFilename;
  48. std::list<std::string> MocIncludes;
  49. std::list<std::string> MocDefinitions;
  50. bool Verbose;
  51. bool RunMocFailed;
  52. bool GenerateAll;
  53. };
  54. #endif