summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-28 19:23:09 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-28 19:23:09 (GMT)
commitfcbe435c235f4fe1e5444a796f085c7a796be88e (patch)
tree00e4f9eff8f5dc77251c61edbd8a81dbdefb48ad /Source/cmQtAutoGenerators.h
parent16df2456a440d87fb3e8e53fb59a2817b288b9af (diff)
parent9c87d9cc3e7a046f79ff62eda81203ef424e4a14 (diff)
downloadCMake-fcbe435c235f4fe1e5444a796f085c7a796be88e.zip
CMake-fcbe435c235f4fe1e5444a796f085c7a796be88e.tar.gz
CMake-fcbe435c235f4fe1e5444a796f085c7a796be88e.tar.bz2
Merge topic 'Qt-auto-generators'
9c87d9c Add automatic rcc invocation for Qt. 84218e1 Add automatic uic invocation for Qt. 94a0ca6 Record which files are skipped by automoc. 18fb758 Run the main executable created in the autogen tests. e485ba1 Rename the QtAutomoc tests to QtAutogen. 7ce65c3 Add extra checks for the AUTOMOC target property. 32771fc Update output messages for generic use. f371ab5 Rename RunAutomoc to RunAutogen. 85b3d6e Extract an SetupAutoMocTarget method. ca124a1 Rename the AutomocInfo.cmake file to be more generic. a342c9f Move some makefile definitions up away from moc-specific code. 98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER. 63378ba Rename some variables to reflect broader scope. 97f1aa3 Rename method to reflect generic use. 4abb111 Rename local variable to reflect generic use. 03878c9 Move variable set to where it is used. ...
Diffstat (limited to 'Source/cmQtAutoGenerators.h')
-rw-r--r--Source/cmQtAutoGenerators.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
new file mode 100644
index 0000000..696abc8
--- /dev/null
+++ b/Source/cmQtAutoGenerators.h
@@ -0,0 +1,131 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2004-2011 Kitware, Inc.
+ Copyright 2011 Alexander Neundorf (neundorf@kde.org)
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef cmQtAutoGenerators_h
+#define cmQtAutoGenerators_h
+
+class cmGlobalGenerator;
+class cmMakefile;
+
+class cmQtAutoGenerators
+{
+public:
+ cmQtAutoGenerators();
+ bool Run(const char* targetDirectory, const char *config);
+
+ bool InitializeMocSourceFile(cmTarget* target);
+ void SetupAutoGenerateTarget(cmTarget* target);
+
+private:
+ void SetupAutoMocTarget(cmTarget* target,
+ const std::string &autogenTargetName,
+ std::map<std::string, std::string> &configIncludes,
+ std::map<std::string, std::string> &configDefines);
+ void SetupAutoUicTarget(cmTarget* target);
+ void SetupAutoRccTarget(cmTarget* target);
+
+ cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
+ const char* targetDirectory);
+
+ bool ReadAutogenInfoFile(cmMakefile* makefile,
+ const char* targetDirectory,
+ const char *config);
+ bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
+ const char* targetDirectory);
+ void WriteOldMocDefinitionsFile(const char* targetDirectory);
+
+ std::string MakeCompileSettingsString(cmMakefile* makefile);
+
+ bool RunAutogen(cmMakefile* makefile);
+ bool GenerateMoc(const std::string& sourceFile,
+ const std::string& mocFileName);
+ bool GenerateUi(const std::string& uiFileName);
+ bool GenerateQrc();
+ void ParseCppFile(const std::string& absFilename,
+ const std::vector<std::string>& headerExtensions,
+ std::map<std::string, std::string>& includedMocs,
+ std::vector<std::string>& includedUis);
+ void StrictParseCppFile(const std::string& absFilename,
+ const std::vector<std::string>& headerExtensions,
+ std::map<std::string, std::string>& includedMocs,
+ std::vector<std::string>& includedUis);
+ void SearchHeadersForCppFile(const std::string& absFilename,
+ const std::vector<std::string>& headerExtensions,
+ std::set<std::string>& absHeaders);
+
+ void ParseHeaders(const std::set<std::string>& absHeaders,
+ const std::map<std::string, std::string>& includedMocs,
+ std::map<std::string, std::string>& notIncludedMocs,
+ std::vector<std::string>& includedUis);
+
+ void ParseForUic(const std::string& fileName,
+ const std::string& contentsString,
+ std::vector<std::string>& includedUis);
+
+ void ParseForUic(const std::string& fileName,
+ std::vector<std::string>& includedUis);
+
+ void Init();
+
+ std::string Join(const std::vector<std::string>& lst, char separator);
+ bool EndsWith(const std::string& str, const std::string& with);
+ bool StartsWith(const std::string& str, const std::string& with);
+ std::string ReadAll(const std::string& filename);
+
+ void MergeUicOptions(std::vector<std::string> &opts,
+ const std::vector<std::string> &fileOpts, bool isQt5);
+
+ void MergeRccOptions(std::vector<std::string> &opts,
+ const std::vector<std::string> &fileOpts, bool isQt5);
+
+ std::string QtMajorVersion;
+ std::string Sources;
+ std::string RccSources;
+ std::string SkipMoc;
+ std::string SkipUic;
+ std::string Headers;
+ bool IncludeProjectDirsBefore;
+ std::string Srcdir;
+ std::string Builddir;
+ std::string MocExecutable;
+ std::string UicExecutable;
+ std::string RccExecutable;
+ std::string MocCompileDefinitionsStr;
+ std::string MocIncludesStr;
+ std::string MocOptionsStr;
+ std::string ProjectBinaryDir;
+ std::string ProjectSourceDir;
+ std::string TargetName;
+
+ std::string CurrentCompileSettingsStr;
+ std::string OldCompileSettingsStr;
+
+ std::string OutMocCppFilename;
+ std::list<std::string> MocIncludes;
+ std::list<std::string> MocDefinitions;
+ std::vector<std::string> MocOptions;
+ std::vector<std::string> UicTargetOptions;
+ std::map<std::string, std::string> UicOptions;
+ std::map<std::string, std::string> RccOptions;
+
+ bool Verbose;
+ bool ColorOutput;
+ bool RunMocFailed;
+ bool RunUicFailed;
+ bool RunRccFailed;
+ bool GenerateAll;
+ bool RelaxedMode;
+
+};
+
+#endif