From 9aeffa6e1192bfc4c0c2558c7fa716e09ab7a4e0 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 6 Jan 2008 17:18:15 -0500 Subject: 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 --- Source/cmFindBase.cxx | 14 ++++++++++++-- 1 file 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); } } -- cgit v0.12