summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-08-30 21:13:10 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-09-07 15:53:19 (GMT)
commitd8d064abbc10239cf61655da31d3e6a4a46298e7 (patch)
treebccc6ce5924ba62aa1e249eabb3a5a8389648206 /Source/cmQtAutoGenerators.cxx
parent37714f884be3c37fbbcbf7bbef0ceb3b44cc5961 (diff)
downloadCMake-d8d064abbc10239cf61655da31d3e6a4a46298e7.zip
CMake-d8d064abbc10239cf61655da31d3e6a4a46298e7.tar.gz
CMake-d8d064abbc10239cf61655da31d3e6a4a46298e7.tar.bz2
Autogen: Use the same algorithm for RCC and UIC option merging
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx39
1 files changed, 2 insertions, 37 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 7f1443e..4e3ec96 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -7,10 +7,8 @@
#include "cmsys/Terminal.h"
#include <algorithm>
#include <array>
-#include <assert.h>
#include <list>
#include <sstream>
-#include <stdlib.h>
#include <string.h>
#include <utility>
@@ -201,40 +199,6 @@ static std::string JoinOptionsMap(
return result;
}
-static void UicMergeOptions(std::vector<std::string>& opts,
- const std::vector<std::string>& fileOpts,
- bool isQt5)
-{
- static const char* valueOptions[] = { "tr", "translate",
- "postfix", "generator",
- "include", // Since Qt 5.3
- "g" };
- std::vector<std::string> extraOpts;
- for (std::vector<std::string>::const_iterator it = fileOpts.begin();
- it != fileOpts.end(); ++it) {
- std::vector<std::string>::iterator existingIt =
- std::find(opts.begin(), opts.end(), *it);
- if (existingIt != opts.end()) {
- const char* o = it->c_str();
- if (*o == '-') {
- ++o;
- }
- if (isQt5 && *o == '-') {
- ++o;
- }
- if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions),
- cmStrCmp(*it)) != cmArrayEnd(valueOptions)) {
- assert(existingIt + 1 != opts.end());
- *(existingIt + 1) = *(it + 1);
- ++it;
- }
- } else {
- extraOpts.push_back(*it);
- }
- }
- opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
-}
-
// -- Class methods
cmQtAutoGenerators::cmQtAutoGenerators()
@@ -1580,7 +1544,8 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName,
if (optionIt != this->UicOptions.end()) {
std::vector<std::string> fileOpts;
cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
- UicMergeOptions(allOpts, fileOpts, (this->QtMajorVersion == "5"));
+ cmQtAutoGen::UicMergeOptions(allOpts, fileOpts,
+ (this->QtMajorVersion == "5"));
}
cmd.insert(cmd.end(), allOpts.begin(), allOpts.end());
}