cmGlobalGenerator: Convert set insert algorithm to vector algorithms.

Adjust test for new error output.
This commit is contained in:
Stephen Kelly 2015-02-18 23:29:18 +01:00
parent 416df93aa9
commit 21b0654ace
2 changed files with 18 additions and 10 deletions

View File

@ -3015,7 +3015,7 @@ void cmGlobalGenerator::AddEvaluationFile(const std::string &inputFile,
//----------------------------------------------------------------------------
void cmGlobalGenerator::ProcessEvaluationFiles()
{
std::set<std::string> generatedFiles;
std::vector<std::string> generatedFiles;
for(std::vector<cmGeneratorExpressionEvaluationFile*>::const_iterator
li = this->EvaluationFiles.begin();
li != this->EvaluationFiles.end();
@ -3027,16 +3027,24 @@ void cmGlobalGenerator::ProcessEvaluationFiles()
return;
}
std::vector<std::string> files = (*li)->GetFiles();
for(std::vector<std::string>::const_iterator fi = files.begin();
fi != files.end(); ++fi)
std::sort(files.begin(), files.end());
std::vector<std::string> intersection;
std::set_intersection(files.begin(), files.end(),
generatedFiles.begin(), generatedFiles.end(),
std::back_inserter(intersection));
if (!intersection.empty())
{
if (!generatedFiles.insert(*fi).second)
{
cmSystemTools::Error("File to be generated by multiple different "
"commands: ", fi->c_str());
return;
}
cmSystemTools::Error("Files to be generated by multiple different "
"commands: ", cmWrap('"', intersection, '"', " ").c_str());
return;
}
generatedFiles.insert(generatedFiles.end(),
files.begin(), files.end());
std::vector<std::string>::iterator newIt =
generatedFiles.end() - files.size();
std::inplace_merge(generatedFiles.begin(), newIt, generatedFiles.end());
}
}

View File

@ -1 +1 @@
CMake Error: File to be generated by multiple different commands: .*CommandConflict-build/output_.*.txt
CMake Error: Files to be generated by multiple different commands: ".*CommandConflict-build/output_.*.txt"