summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-09-16 23:23:57 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-09-18 07:41:16 (GMT)
commite3c97a1914aa0a521b55b53ab1b0d71732c5e466 (patch)
tree2bf4429537174c4457b7ba9b6cc431f3a7013c88 /Source/cmQtAutoGenerators.cxx
parentb8877b1d62599bba7a014e95fbbd670f177243ce (diff)
downloadCMake-e3c97a1914aa0a521b55b53ab1b0d71732c5e466.zip
CMake-e3c97a1914aa0a521b55b53ab1b0d71732c5e466.tar.gz
CMake-e3c97a1914aa0a521b55b53ab1b0d71732c5e466.tar.bz2
QtAutogen: Process all ui files in a source file (#14981).
Use a vector to store a list of matched ui_ includes, instead of overwriting the previous match.
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx41
1 files changed, 23 insertions, 18 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4b8f810..b9d3004 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1296,8 +1296,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
const std::vector<std::string>& headerExtensions =
makefile->GetHeaderExtensions();
- std::map<std::string, std::string> includedUis;
- std::map<std::string, std::string> skippedUis;
+ std::map<std::string, std::vector<std::string> > includedUis;
+ std::map<std::string, std::vector<std::string> > skippedUis;
std::vector<std::string> uicSkipped;
cmSystemTools::ExpandListArgument(this->SkipUic, uicSkipped);
@@ -1307,7 +1307,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
{
const bool skipUic = std::find(uicSkipped.begin(), uicSkipped.end(), *it)
!= uicSkipped.end();
- std::map<std::string, std::string>& uiFiles
+ std::map<std::string, std::vector<std::string> >& uiFiles
= skipUic ? skippedUis : includedUis;
const std::string &absFilename = *it;
if (this->Verbose)
@@ -1368,12 +1368,17 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
{
this->GenerateMoc(it->first, it->second);
}
- for(std::map<std::string, std::string>::const_iterator
+ for(std::map<std::string, std::vector<std::string> >::const_iterator
it = includedUis.begin();
it != includedUis.end();
++it)
{
- this->GenerateUi(it->first, it->second);
+ for (std::vector<std::string>::const_iterator nit = it->second.begin();
+ nit != it->second.end();
+ ++nit)
+ {
+ this->GenerateUi(it->first, *nit);
+ }
}
if(!this->RccExecutable.empty())
@@ -1448,9 +1453,9 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
- const std::vector<std::string>& headerExtensions,
- std::map<std::string, std::string>& includedMocs,
- std::map<std::string, std::string> &includedUis)
+ const std::vector<std::string>& headerExtensions,
+ std::map<std::string, std::string>& includedMocs,
+ std::map<std::string, std::vector<std::string> > &includedUis)
{
cmsys::RegularExpression mocIncludeRegExp(
"[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1636,9 +1641,9 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
- const std::vector<std::string>& headerExtensions,
- std::map<std::string, std::string>& includedMocs,
- std::map<std::string, std::string>& includedUis)
+ const std::vector<std::string>& headerExtensions,
+ std::map<std::string, std::string>& includedMocs,
+ std::map<std::string, std::vector<std::string> >& includedUis)
{
cmsys::RegularExpression mocIncludeRegExp(
"[\n][ \t]*#[ \t]*include[ \t]+"
@@ -1756,7 +1761,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
- std::map<std::string, std::string>& includedUis)
+ std::map<std::string, std::vector<std::string> >& includedUis)
{
if (this->UicExecutable.empty())
{
@@ -1774,8 +1779,8 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
- const std::string& contentsString,
- std::map<std::string, std::string>& includedUis)
+ const std::string& contentsString,
+ std::map<std::string, std::vector<std::string> >& includedUis)
{
if (this->UicExecutable.empty())
{
@@ -1805,7 +1810,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
// finding the correct header, so we need to remove the ui_ part
basename = basename.substr(3);
- includedUis[realName] = basename;
+ includedUis[realName].push_back(basename);
matchOffset += uiIncludeRegExp.end();
} while(uiIncludeRegExp.find(contentsString.c_str() + matchOffset));
@@ -1851,9 +1856,9 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
- const std::map<std::string, std::string>& includedMocs,
- std::map<std::string, std::string>& notIncludedMocs,
- std::map<std::string, std::string>& includedUis)
+ const std::map<std::string, std::string>& includedMocs,
+ std::map<std::string, std::string>& notIncludedMocs,
+ std::map<std::string, std::vector<std::string> >& includedUis)
{
for(std::set<std::string>::const_iterator hIt=absHeaders.begin();
hIt!=absHeaders.end();