Eclipse: don't create VirtualFolders if not supported

Eclipse versions before 3.6 (Helios) did not support
VirtualFolders yet (#12479), so only create them if Eclipse
is new enough.

Alex
This commit is contained in:
Alex Neundorf 2011-10-15 21:03:14 +02:00
parent 5b200e3bed
commit b4b2fc33f9

View File

@ -420,29 +420,32 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
} }
// for each sub project create a linked resource to the source dir if (this->SupportsVirtualFolders)
// - only if it is an out-of-source build
this->AppendLinkedResource(fout, "[Subprojects]",
"virtual:/virtual", true);
for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
it = this->GlobalGenerator->GetProjectMap().begin();
it != this->GlobalGenerator->GetProjectMap().end();
++it)
{ {
std::string linkSourceDirectory = this->GetEclipsePath( // for each sub project create a linked resource to the source dir
it->second[0]->GetMakefile()->GetStartDirectory()); // - only if it is an out-of-source build
// a linked resource must not point to a parent directory of .project or this->AppendLinkedResource(fout, "[Subprojects]",
// .project itself "virtual:/virtual", true);
if ((this->HomeOutputDirectory != linkSourceDirectory) &&
!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(), for (std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
linkSourceDirectory.c_str())) it = this->GlobalGenerator->GetProjectMap().begin();
it != this->GlobalGenerator->GetProjectMap().end();
++it)
{ {
std::string linkName = "[Subprojects]/"; std::string linkSourceDirectory = this->GetEclipsePath(
linkName += it->first; it->second[0]->GetMakefile()->GetStartDirectory());
this->AppendLinkedResource(fout, linkName, // a linked resource must not point to a parent directory of .project or
this->GetEclipsePath(linkSourceDirectory)); // .project itself
this->SrcLinkedResources.push_back(it->first); if ((this->HomeOutputDirectory != linkSourceDirectory) &&
!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
linkSourceDirectory.c_str()))
{
std::string linkName = "[Subprojects]/";
linkName += it->first;
this->AppendLinkedResource(fout, linkName,
this->GetEclipsePath(linkSourceDirectory));
this->SrcLinkedResources.push_back(it->first);
}
} }
} }