summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-20 16:37:20 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-20 16:37:20 (GMT)
commit870bd16f2c64dc8d74056a47bc7845e8d1b3b2f1 (patch)
tree3af8a6f2b0b15e59f3be09ebca3850a29d57c28e
parent6820882be57942403fa7eaf706a0169fd2816fc2 (diff)
downloadCMake-870bd16f2c64dc8d74056a47bc7845e8d1b3b2f1.zip
CMake-870bd16f2c64dc8d74056a47bc7845e8d1b3b2f1.tar.gz
CMake-870bd16f2c64dc8d74056a47bc7845e8d1b3b2f1.tar.bz2
QtAutogen: Don't modify target source files while iterating them.
Populate a separate vector of files and append them separately. This was the pattern used prior to commit 035b6908 (Autogen: Split AutoRcc handling into two methods, 2013-12-10), which was erroneously not maintained in that refactoring.
-rw-r--r--Source/cmQtAutoGenerators.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a561aab..abf20cb 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -810,6 +810,8 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
+ std::vector<cmSourceFile*> newFiles;
+
for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end();
++fileIt)
@@ -833,10 +835,17 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
rcc_output_file.c_str(), false);
cmSourceFile* rccCppSource
= makefile->GetOrCreateSource(rcc_output_file.c_str(), true);
- target->AddSourceFile(rccCppSource);
+ newFiles.push_back(rccCppSource);
}
}
}
+
+ for(std::vector<cmSourceFile*>::const_iterator fileIt = newFiles.begin();
+ fileIt != newFiles.end();
+ ++fileIt)
+ {
+ target->AddSourceFile(*fileIt);
+ }
}
void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)