summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGen.h
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-08-26 11:59:57 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-09-07 15:53:18 (GMT)
commitd1e5eb849704f73d646f64105d44807f3de50e48 (patch)
tree2246c9fd4e76d5f6eecdf42372d7c28adfc19b0a /Source/cmQtAutoGen.h
parent25ac91a715ee5f21fd169c47d55e02234c00915f (diff)
downloadCMake-d1e5eb849704f73d646f64105d44807f3de50e48.zip
CMake-d1e5eb849704f73d646f64105d44807f3de50e48.tar.gz
CMake-d1e5eb849704f73d646f64105d44807f3de50e48.tar.bz2
Autogen: Iterate source files only once
This is a large commit that serves multiple purposes - Iterate source files only once and store all extracted information in a cmQtAutogenDigest class that can be reused. This is brings speed improvements because several properties are only evaluated once. More that that it helps to avoid duplication of code with non trivial files property checks. - Fix the Visual Studio generator to use PRE_BUILD when possible. - Convert `for( ... )` loops to C++11 range base loops where possible (cmQtAutogen*.cxx only). - String concatenation optimizations.
Diffstat (limited to 'Source/cmQtAutoGen.h')
-rw-r--r--Source/cmQtAutoGen.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
new file mode 100644
index 0000000..88fd0fc
--- /dev/null
+++ b/Source/cmQtAutoGen.h
@@ -0,0 +1,47 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmQtAutoGen_h
+#define cmQtAutoGen_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <string>
+#include <vector>
+
+/** \class cmQtAutoGen
+ * \brief Class used as namespace for QtAutogen related types and functions
+ */
+class cmQtAutoGen
+{
+public:
+ static const std::string listSep;
+
+ enum GeneratorType
+ {
+ GEN, // General
+ MOC,
+ UIC,
+ RCC
+ };
+
+public:
+ /// @brief Returns the generator name
+ static const std::string& GeneratorName(GeneratorType genType);
+ /// @brief Returns the generator name in upper case
+ static std::string GeneratorNameUpper(GeneratorType genType);
+
+ /// @brief Returns a the string escaped and enclosed in quotes
+ ///
+ static std::string Quoted(const std::string& text);
+
+ /// @brief Reads the resource files list from from a .qrc file
+ /// @arg fileName Must be the absolute path of the .qrc file
+ /// @return True if the rcc file was successfully parsed
+ static bool RccListInputs(const std::string& qtMajorVersion,
+ const std::string& rccCommand,
+ const std::string& fileName,
+ std::vector<std::string>& files,
+ std::string* errorMessage = nullptr);
+};
+
+#endif