From 4ea5dc5ba5d9e73d013d3a1166d321a8433a3384 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 28 Jul 2012 18:42:47 +0200 Subject: 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 --- Source/cmExtraEclipseCDT4Generator.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- cgit v1.2.1