summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraEclipseCDT4Generator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2010-02-13 16:08:42 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2010-02-13 16:08:42 (GMT)
commit10aece0d8199409fbb695478eab2c60545fcf310 (patch)
tree722f520342afe8a2e7906ee6e5b15db8585388af /Source/cmExtraEclipseCDT4Generator.cxx
parentaa2b217d1d69bc5570f5877f1e6ff315e039f279 (diff)
downloadCMake-10aece0d8199409fbb695478eab2c60545fcf310.zip
CMake-10aece0d8199409fbb695478eab2c60545fcf310.tar.gz
CMake-10aece0d8199409fbb695478eab2c60545fcf310.tar.bz2
-fix bug for Eclipse projects where targets which are in a subdir which has the same name as the project (... and so the linked resource) could not be built
http://public.kitware.com/Bug/view.php?id=9978 Now instead of one linked resource for each project() just one linked resource to the top level source directory is created. This should really avoid this type of name clashes. And to me it looks also much less confusing. Hopefully the name "[Source directory]" containing a space and square brackets doesn't lead to problems somewhere. Here it works. Alex
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 43c8b21..fe914fd 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -43,9 +43,9 @@ void cmExtraEclipseCDT4Generator
entry.Name = this->GetName();
entry.Brief = "Generates Eclipse CDT 4.0 project files.";
entry.Full =
- "Project files for Eclipse will be created in the top directory "
- "and will have a linked resource to every subdirectory which "
- "features a CMakeLists.txt file containing a PROJECT() call."
+ "Project files for Eclipse will be created in the top directory. "
+ "In out of source builds, a linked resource to the top level source "
+ "directory will be created."
"Additionally a hierarchy of makefiles is generated into the "
"build tree. The appropriate make program can build the project through "
"the default make target. A \"make install\" target is also provided.";
@@ -392,24 +392,24 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
if (this->IsOutOfSourceBuild)
{
fout << "\t<linkedResources>\n";
- // for each sub project create a linked resource to the source dir
- // - only if it is an out-of-source build
- 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(
- it->second[0]->GetMakefile()->GetStartDirectory());
- // .project dir can't be subdir of a linked resource dir
- if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
+ // create a linked resource to CMAKE_SOURCE_DIR
+ // (this is not done anymore for each project because of
+ // http://public.kitware.com/Bug/view.php?id=9978 and because I found it
+ // actually quite confusing in bigger projects with many directories and
+ // projects, Alex
+
+ std::string sourceLinkedResourceName = "[Source directory]";
+ std::string linkSourceDirectory = this->GetEclipsePath(
+ mf->GetStartDirectory());
+ // .project dir can't be subdir of a linked resource dir
+ if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
linkSourceDirectory.c_str()))
- {
- this->AppendLinkedResource(fout, it->first,
- this->GetEclipsePath(linkSourceDirectory));
- this->SrcLinkedResources.push_back(it->first);
- }
+ {
+ this->AppendLinkedResource(fout, sourceLinkedResourceName,
+ this->GetEclipsePath(linkSourceDirectory));
+ this->SrcLinkedResources.push_back(sourceLinkedResourceName);
}
+
// for EXECUTABLE_OUTPUT_PATH when not in binary dir
this->AppendOutLinkedResource(fout,
mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),