diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-05 16:50:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-05 16:50:47 (GMT) |
commit | 2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07 (patch) | |
tree | 9b86b8e6d58f19d8bc2d50a53b56876a496d5d53 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | 59b91107d16c2f2ba68791ae67c53bdcc0d32e05 (diff) | |
download | CMake-2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07.zip CMake-2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07.tar.gz CMake-2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07.tar.bz2 |
QtAutogen: Move MergeRccOptions method.
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 5cb22e9..9bece40 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -391,6 +391,50 @@ std::string cmQtAutoGeneratorInitializer::GetRccExecutable( return std::string(); } +void cmQtAutoGeneratorInitializer::MergeRccOptions( + std::vector<std::string> &opts, + const std::vector<std::string> &fileOpts, + bool isQt5) +{ + static const char* valueOptions[] = { + "name", + "root", + "compress", + "threshold" + }; + 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()); +} + std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName( cmTarget const* target) { @@ -912,50 +956,6 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( } } -void cmQtAutoGeneratorInitializer::MergeRccOptions( - std::vector<std::string> &opts, - const std::vector<std::string> &fileOpts, - bool isQt5) -{ - static const char* valueOptions[] = { - "name", - "root", - "compress", - "threshold" - }; - 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()); -} - void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target) { std::string _rcc_files; |