summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraEclipseCDT4Generator.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-07-28 16:42:47 (GMT)
committerAlex Neundorf <neundorf@kde.org>2012-07-28 16:42:47 (GMT)
commit4ea5dc5ba5d9e73d013d3a1166d321a8433a3384 (patch)
tree1913d648a1bf46e89cfe6fb3e0e7f672c1cc11d5 /Source/cmExtraEclipseCDT4Generator.cxx
parentf66c82c8ac09e2671f483d27c9b2c214b41ba819 (diff)
downloadCMake-4ea5dc5ba5d9e73d013d3a1166d321a8433a3384.zip
CMake-4ea5dc5ba5d9e73d013d3a1166d321a8433a3384.tar.gz
CMake-4ea5dc5ba5d9e73d013d3a1166d321a8433a3384.tar.bz2
Eclipse: fix #13358: don't create bad linked resources
Don't create linked resources which point to CMAKE_BINARY_DIR itself or one of its parent dirs. Eclipse complained about that. Alex
Diffstat (limited to 'Source/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 78a8704..5c7d400 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -1334,12 +1334,26 @@ bool cmExtraEclipseCDT4Generator
{
outputPath = this->HomeOutputDirectory + "/" + outputPath;
}
+
+ // in this case it's not necessary:
if (cmSystemTools::IsSubDirectory(outputPath.c_str(),
this->HomeOutputDirectory.c_str()))
{
return false;
}
+ // in these two cases Eclipse would complain:
+ if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
+ outputPath.c_str()))
+ {
+ return false;
+ }
+ if (cmSystemTools::GetRealPath(outputPath.c_str())
+ == cmSystemTools::GetRealPath(this->HomeOutputDirectory.c_str()))
+ {
+ return false;
+ }
+
std::string name = this->GetPathBasename(outputPath);
// make sure linked resource name is unique