Merge topic 'EclipseFixIndexerBySettingSourcePath'

077de8b Eclipse: set source path once to fix Eclipse indexer (#13596)
This commit is contained in:
Brad King 2012-11-06 14:13:55 -05:00 committed by CMake Topic Stage
commit 93a324975c

View File

@ -592,7 +592,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
this->GetEclipsePath(linkSourceDirectory), this->GetEclipsePath(linkSourceDirectory),
LinkToFolder LinkToFolder
); );
this->SrcLinkedResources.push_back(it->first); // Don't add it to the srcLinkedResources, because listing multiple
// directories confuses the Eclipse indexer (#13596).
} }
} }
} }
@ -743,15 +744,16 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
/* I don't know what the pathentry kind="src" are good for, e.g. autocompletion /* I don't know what the pathentry kind="src" are good for, e.g. autocompletion
* works also without them. Done wrong, the indexer complains, see #12417 * works also without them. Done wrong, the indexer complains, see #12417
* and #12213. * and #12213.
* According to #13596, this entry at least limits the directories the
* indexer is searching for files. So now the "src" entry contains only
* the linked resource to CMAKE_SOURCE_DIR.
* The CDT documentation is very terse on that: * The CDT documentation is very terse on that:
* "CDT_SOURCE: Entry kind constant describing a path entry identifying a * "CDT_SOURCE: Entry kind constant describing a path entry identifying a
* folder containing source code to be compiled." * folder containing source code to be compiled."
* Also on the cdt-dev list didn't bring any information: * Also on the cdt-dev list didn't bring any information:
* http://web.archiveorange.com/archive/v/B4NlJDNIpYoOS1SbxFNy * http://web.archiveorange.com/archive/v/B4NlJDNIpYoOS1SbxFNy
* So I'm disabling them for now, hoping that somebody will report if something
* is not workging anymore.
* Alex */ * Alex */
#ifdef DO_CREATE_SRC_PATH_ENTRIES
for (std::vector<std::string>::const_iterator for (std::vector<std::string>::const_iterator
it = this->SrcLinkedResources.begin(); it = this->SrcLinkedResources.begin();
it != this->SrcLinkedResources.end(); it != this->SrcLinkedResources.end();
@ -768,7 +770,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
excludeFromOut += this->EscapeForXML(*it) + "/|"; excludeFromOut += this->EscapeForXML(*it) + "/|";
} }
} }
#endif
excludeFromOut += "**/CMakeFiles/"; excludeFromOut += "**/CMakeFiles/";
fout << "<pathentry excluding=\"" << excludeFromOut fout << "<pathentry excluding=\"" << excludeFromOut
<< "\" kind=\"out\" path=\"\"/>\n"; << "\" kind=\"out\" path=\"\"/>\n";