diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-10-15 19:03:14 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-10-15 19:03:14 (GMT) |
commit | b4b2fc33f936631b826456bfa098dcd2702e914d (patch) | |
tree | 2bd514945f6f1b2081136d93596bb55a43119e66 /Source | |
parent | 5b200e3bed8e450027ddad42a155d670f247e58c (diff) | |
download | CMake-b4b2fc33f936631b826456bfa098dcd2702e914d.zip CMake-b4b2fc33f936631b826456bfa098dcd2702e914d.tar.gz CMake-b4b2fc33f936631b826456bfa098dcd2702e914d.tar.bz2 |
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
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 21b1b61..f303f16 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -420,29 +420,32 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() } - // for each sub project create a linked resource to the source dir - // - 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) + if (this->SupportsVirtualFolders) { - std::string linkSourceDirectory = this->GetEclipsePath( - it->second[0]->GetMakefile()->GetStartDirectory()); - // a linked resource must not point to a parent directory of .project or - // .project itself - if ((this->HomeOutputDirectory != linkSourceDirectory) && - !cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(), - linkSourceDirectory.c_str())) + // for each sub project create a linked resource to the source dir + // - 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 linkName = "[Subprojects]/"; - linkName += it->first; - this->AppendLinkedResource(fout, linkName, - this->GetEclipsePath(linkSourceDirectory)); - this->SrcLinkedResources.push_back(it->first); + std::string linkSourceDirectory = this->GetEclipsePath( + it->second[0]->GetMakefile()->GetStartDirectory()); + // a linked resource must not point to a parent directory of .project or + // .project itself + 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); + } } } |