From 2aa3f500c49e6c81f4d4b821d6ae71ef2589cb07 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 18:50:47 +0200 Subject: [PATCH] QtAutogen: Move MergeRccOptions method. --- Source/cmQtAutoGeneratorInitializer.cxx | 88 ++++++++++++------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 5cb22e953..9bece40ef 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 &opts, + const std::vector &fileOpts, + bool isQt5) +{ + static const char* valueOptions[] = { + "name", + "root", + "compress", + "threshold" + }; + std::vector extraOpts; + for(std::vector::const_iterator it = fileOpts.begin(); + it != fileOpts.end(); ++it) + { + std::vector::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 &opts, - const std::vector &fileOpts, - bool isQt5) -{ - static const char* valueOptions[] = { - "name", - "root", - "compress", - "threshold" - }; - std::vector extraOpts; - for(std::vector::const_iterator it = fileOpts.begin(); - it != fileOpts.end(); ++it) - { - std::vector::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;