summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-01-06 22:18:15 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-01-06 22:18:15 (GMT)
commit9aeffa6e1192bfc4c0c2558c7fa716e09ab7a4e0 (patch)
tree014691582599c8c656ad845dc90a1aec68d32c42 /Source/cmFindBase.cxx
parent6c073ddb65c574da3d947efe62b6385e9ef00d5e (diff)
downloadCMake-9aeffa6e1192bfc4c0c2558c7fa716e09ab7a4e0.zip
CMake-9aeffa6e1192bfc4c0c2558c7fa716e09ab7a4e0.tar.gz
CMake-9aeffa6e1192bfc4c0c2558c7fa716e09ab7a4e0.tar.bz2
BUG: fix #6105, if a directory inside CMAKE_FIND_ROOT_PATH is given to a
FIND_XXX() command, don't prepend the root to it (since it is already in this root) Alex
Diffstat (limited to 'Source/cmFindBase.cxx')
-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);
}
}