diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-02-07 23:24:55 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-02-07 23:24:55 (GMT) |
commit | 251565785a87c9edad62b1224778c23740b64e9c (patch) | |
tree | cfaedb67282ba1fcb4886f96c0860836c0c06211 /Source/cmExtraEclipseCDT4Generator.cxx | |
parent | dcd29a14b0ab92f6a509d4d1176979975b687b89 (diff) | |
download | CMake-251565785a87c9edad62b1224778c23740b64e9c.zip CMake-251565785a87c9edad62b1224778c23740b64e9c.tar.gz CMake-251565785a87c9edad62b1224778c23740b64e9c.tar.bz2 |
patch from Miguel
BUG: fix #5496: eclipse can't load projects where the build dir is a subdir
of the src dir
Alex
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 8edd57f..e4fa0edc 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -283,16 +283,21 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile() const it != this->GlobalGenerator->GetProjectMap().end(); ++it) { - fout << - "\t\t<link>\n" - "\t\t\t<name>" << it->first << "</name>\n" - "\t\t\t<type>2</type>\n" - "\t\t\t<location>" - << this->GetEclipsePath( - it->second[0]->GetMakefile()->GetStartDirectory()) - << "</location>\n" - "\t\t</link>\n" - ; + std::string linkSourceDirectory =this->GetEclipsePath( + it->second[0]->GetMakefile()->GetStartDirectory()); + if (!cmSystemTools::IsSubDirectory(homeOutputDirectory.c_str(), + linkSourceDirectory.c_str())) + { + fout << + "\t\t<link>\n" + "\t\t\t<name>" << it->first << "</name>\n" + "\t\t\t<type>2</type>\n" + "\t\t\t<location>" + << this->GetEclipsePath(linkSourceDirectory) + << "</location>\n" + "\t\t</link>\n" + ; + } } // for EXECUTABLE_OUTPUT_PATH when not in binary dir std::string output_path = mf->GetDefinition("EXECUTABLE_OUTPUT_PATH"); |