BUG: work around for buggy Tigger OSX systems that read two copies of the same file in a directory

This commit is contained in:
Bill Hoffman 2005-04-15 10:46:19 -04:00
parent 6c68c81475
commit b1541f3ee5

View File

@ -282,11 +282,17 @@ void cmTryCompileCommand::CleanupFiles(const char* binDir)
cmsys::Directory dir; cmsys::Directory dir;
dir.Load(binDir); dir.Load(binDir);
size_t fileNum; size_t fileNum;
std::set<cmStdString> deletedFiles;
for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum) for (fileNum = 0; fileNum < dir.GetNumberOfFiles(); ++fileNum)
{ {
if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".") && if (strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".") &&
strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),"..")) strcmp(dir.GetFile(static_cast<unsigned long>(fileNum)),".."))
{ {
if(deletedFiles.find( dir.GetFile(static_cast<unsigned long>(fileNum)))
== deletedFiles.end())
{
deletedFiles.insert(dir.GetFile(static_cast<unsigned long>(fileNum)));
std::string fullPath = binDir; std::string fullPath = binDir;
fullPath += "/"; fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum)); fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
@ -306,3 +312,4 @@ void cmTryCompileCommand::CleanupFiles(const char* binDir)
} }
} }
} }
}