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
This commit is contained in:
Alexander Neundorf 2008-01-06 17:18:15 -05:00
parent 6c073ddb65
commit 9aeffa6e11
1 changed files with 12 additions and 2 deletions

View File

@ -536,8 +536,18 @@ void cmFindBase::HandleCMakeFindRootPath()
it != unrootedPaths.end(); it != unrootedPaths.end();
++it ) ++it )
{ {
std::string rootedDir=*rootIt; // if the current directory is already inside the current root, don't
rootedDir+=*it; // 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); this->SearchPaths.push_back(rootedDir);
} }
} }