1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2004-2011 Kitware, Inc.
4 Copyright 2011 Alexander Neundorf (neundorf@kde.org)
6 Distributed under the OSI-approved BSD License (the "License");
7 see accompanying file Copyright.txt for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even the
10 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 See the License for more information.
12 ============================================================================*/
17 class cmGlobalGenerator;
24 bool Run(const char* targetDirectory, const char *config);
26 bool InitializeMocSourceFile(cmTarget* target);
27 void SetupAutomocTarget(cmTarget* target);
30 cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
31 const char* targetDirectory);
33 bool ReadAutomocInfoFile(cmMakefile* makefile,
34 const char* targetDirectory,
36 bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
37 const char* targetDirectory);
38 void WriteOldMocDefinitionsFile(const char* targetDirectory);
40 std::string MakeCompileSettingsString(cmMakefile* makefile);
42 bool RunAutomoc(cmMakefile* makefile);
43 bool GenerateMoc(const std::string& sourceFile,
44 const std::string& mocFileName);
45 void ParseCppFile(const std::string& absFilename,
46 const std::vector<std::string>& headerExtensions,
47 std::map<std::string, std::string>& includedMocs);
48 void StrictParseCppFile(const std::string& absFilename,
49 const std::vector<std::string>& headerExtensions,
50 std::map<std::string, std::string>& includedMocs);
51 void SearchHeadersForCppFile(const std::string& absFilename,
52 const std::vector<std::string>& headerExtensions,
53 std::set<std::string>& absHeaders);
55 void ParseHeaders(const std::set<std::string>& absHeaders,
56 const std::map<std::string, std::string>& includedMocs,
57 std::map<std::string, std::string>& notIncludedMocs);
61 std::string Join(const std::vector<std::string>& lst, char separator);
62 bool EndsWith(const std::string& str, const std::string& with);
63 bool StartsWith(const std::string& str, const std::string& with);
64 std::string ReadAll(const std::string& filename);
66 std::string QtMajorVersion;
69 bool IncludeProjectDirsBefore;
72 std::string MocExecutable;
73 std::string MocCompileDefinitionsStr;
74 std::string MocIncludesStr;
75 std::string MocOptionsStr;
76 std::string ProjectBinaryDir;
77 std::string ProjectSourceDir;
78 std::string TargetName;
80 std::string CurrentCompileSettingsStr;
81 std::string OldCompileSettingsStr;
83 std::string OutMocCppFilename;
84 std::list<std::string> MocIncludes;
85 std::list<std::string> MocDefinitions;
86 std::vector<std::string> MocOptions;