diff options
-rw-r--r-- | Source/cmQtAutoGeneratorCommon.cxx | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 5 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 50 |
3 files changed, 31 insertions, 26 deletions
diff --git a/Source/cmQtAutoGeneratorCommon.cxx b/Source/cmQtAutoGeneratorCommon.cxx index c42f71d..5146b1a 100644 --- a/Source/cmQtAutoGeneratorCommon.cxx +++ b/Source/cmQtAutoGeneratorCommon.cxx @@ -152,7 +152,7 @@ static bool RccListInputsQt5(const std::string& rccCommand, // - Class definitions -const char* cmQtAutoGeneratorCommon::listSep = "@list_sep@"; +const char* cmQtAutoGeneratorCommon::listSep = "@LSEP@"; bool cmQtAutoGeneratorCommon::RccListInputs(const std::string& qtMajorVersion, const std::string& rccCommand, diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 151f39c..0f29e02 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -489,16 +489,17 @@ static void RccSetupAutoTarget(cmGeneratorTarget const* target, _rcc_files.push_back(absFile); // qrc file entries { - std::string entriesList; + std::string entriesList = "{"; if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { std::vector<std::string> files; if (cmQtAutoGeneratorCommon::RccListInputs( qtMajorVersion, rccCommand, absFile, files)) { - entriesList = cmJoin(files, cmQtAutoGeneratorCommon::listSep); + entriesList += cmJoin(files, cmQtAutoGeneratorCommon::listSep); } else { return; } } + entriesList += "}"; _rcc_inputs.push_back(entriesList); } // rcc options for this qrc file diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index bc9c511..4d14e99 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -441,49 +441,53 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( // - Rcc if (this->RccEnabled()) { InfoGet(makefile, "AM_RCC_SOURCES", this->RccSources); + // File options { std::vector<std::string> rccFilesVec; std::vector<std::string> rccOptionsVec; InfoGet(makefile, "AM_RCC_OPTIONS_FILES", rccFilesVec); InfoGet(makefile, "AM_RCC_OPTIONS_OPTIONS", rccOptionsVec); if (rccFilesVec.size() != rccOptionsVec.size()) { + for (std::vector<std::string>::iterator + fileIt = rccFilesVec.begin(), + optionIt = rccOptionsVec.begin(); + fileIt != rccFilesVec.end(); ++fileIt, ++optionIt) { + // Replace item separator + cmSystemTools::ReplaceString(*optionIt, + cmQtAutoGeneratorCommon::listSep, ";"); + this->RccOptions[*fileIt] = *optionIt; + } + } else { this->LogError( "AutoGen: Error: RCC files/options lists size missmatch in: " + filename); return false; } - for (std::vector<std::string>::iterator fileIt = rccFilesVec.begin(), - optionIt = rccOptionsVec.begin(); - fileIt != rccFilesVec.end(); ++fileIt, ++optionIt) { - cmSystemTools::ReplaceString(*optionIt, - cmQtAutoGeneratorCommon::listSep, ";"); - this->RccOptions[*fileIt] = *optionIt; - } } + // File lists { std::vector<std::string> rccInputLists; InfoGet(makefile, "AM_RCC_INPUTS", rccInputLists); - - // qrc files in the end of the list may have been empty - if (rccInputLists.size() < this->RccSources.size()) { - rccInputLists.resize(this->RccSources.size()); - } - if (this->RccSources.size() != rccInputLists.size()) { + if (this->RccSources.size() == rccInputLists.size()) { + for (std::vector<std::string>::iterator + fileIt = this->RccSources.begin(), + inputIt = rccInputLists.begin(); + fileIt != this->RccSources.end(); ++fileIt, ++inputIt) { + // Remove braces + *inputIt = inputIt->substr(1, inputIt->size() - 2); + // Replace item separator + cmSystemTools::ReplaceString(*inputIt, + cmQtAutoGeneratorCommon::listSep, ";"); + std::vector<std::string> rccInputFiles; + cmSystemTools::ExpandListArgument(*inputIt, rccInputFiles); + this->RccInputs[*fileIt] = rccInputFiles; + } + } else { this->LogError( "AutoGen: Error: RCC sources/inputs lists size missmatch in: " + filename); return false; } - for (std::vector<std::string>::iterator - fileIt = this->RccSources.begin(), - inputIt = rccInputLists.begin(); - fileIt != this->RccSources.end(); ++fileIt, ++inputIt) { - cmSystemTools::ReplaceString(*inputIt, - cmQtAutoGeneratorCommon::listSep, ";"); - std::vector<std::string> rccInputFiles; - cmSystemTools::ExpandListArgument(*inputIt, rccInputFiles); - this->RccInputs[*fileIt] = rccInputFiles; - } } } |