summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-08-13 13:27:17 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2012-08-13 13:27:17 -0400
commit20f56a7eed52a4ab113bb6973d0107bb892e3366 (patch)
tree86d6cce3c92c779cbeb46a8c743516357ff814eb
parent1b9684562b75f09c445a0528fe6c47c1954f5fbb (diff)
parent4ea5dc5ba5d9e73d013d3a1166d321a8433a3384 (diff)
downloadcmake-20f56a7eed52a4ab113bb6973d0107bb892e3366.tar.gz
Merge topic 'EclipseFixBadLinkedResources'
4ea5dc5 Eclipse: fix #13358: don't create bad linked resources
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 78a87047af..5c7d4002f6 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