summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFindBase.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index dea1642..bfe9ee9 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -536,8 +536,18 @@ void cmFindBase::HandleCMakeFindRootPath()
it != unrootedPaths.end();
++it )
{
- std::string rootedDir=*rootIt;
- rootedDir+=*it;
+ // if the current directory is already inside the current root, don't
+ // add the root again
+ std::string rootedDir;
+ if (cmSystemTools::IsSubDirectory(it->c_str(), rootIt->c_str()))
+ {
+ rootedDir = *it;
+ }
+ else
+ {
+ rootedDir=*rootIt;
+ rootedDir+=*it;
+ }
this->SearchPaths.push_back(rootedDir);
}
}