STYLE: Fixed terminology to avoid confusion between roots and prefixes.

This commit is contained in:
Brad King 2007-12-15 14:14:05 -05:00
parent 99dfcc05ef
commit 540a98aa45
1 changed files with 16 additions and 15 deletions

View File

@ -127,11 +127,12 @@ cmFindBase::cmFindBase()
" \"ONLY\" - Only try to find application bundles.\n" " \"ONLY\" - Only try to find application bundles.\n"
" \"NEVER\". - Never try to find application bundles.\n" " \"NEVER\". - Never try to find application bundles.\n"
"The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more " "The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more "
"directories which will be prefixed to all of the search directories. " "directories to be prepended to all other search directories. "
"This effectively \"re-roots\" the entire search under given locations. "
"By default it is empty. It is especially useful when " "By default it is empty. It is especially useful when "
"cross-compiling to point to the root directory of the " "cross-compiling to point to the root directory of the "
"target environment and CMake will search there too. By default at first " "target environment and CMake will search there too. By default at first "
"the directories listed in CMAKE_FIND_ROOT_PATH and then the non-prefixed " "the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted "
"directories will be searched. " "directories will be searched. "
"The default behavior can be adjusted by setting " "The default behavior can be adjusted by setting "
"CMAKE_FIND_ROOT_PATH_MODE_XXX. This behavior can be manually " "CMAKE_FIND_ROOT_PATH_MODE_XXX. This behavior can be manually "
@ -139,7 +140,7 @@ cmFindBase::cmFindBase()
"By using CMAKE_FIND_ROOT_PATH_BOTH the search order will " "By using CMAKE_FIND_ROOT_PATH_BOTH the search order will "
"be as described above. If NO_CMAKE_FIND_ROOT_PATH is used " "be as described above. If NO_CMAKE_FIND_ROOT_PATH is used "
"then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH " "then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH "
"is used then only the prefixed directories will be searched.\n" "is used then only the re-rooted directories will be searched.\n"
"The reason the paths listed in the call to the command are searched " "The reason the paths listed in the call to the command are searched "
"last is that most users of CMake would expect things to be found " "last is that most users of CMake would expect things to be found "
"first in the locations specified by their environment. Projects may " "first in the locations specified by their environment. Projects may "
@ -520,29 +521,29 @@ void cmFindBase::HandleCMakeFindRootPath()
return; return;
} }
std::vector<std::string> prefixes; std::vector<std::string> roots;
cmSystemTools::ExpandListArgument(rootPath, prefixes); cmSystemTools::ExpandListArgument(rootPath, roots);
std::vector<std::string> unprefixedPaths=this->SearchPaths; std::vector<std::string> unrootedPaths=this->SearchPaths;
this->SearchPaths.clear(); this->SearchPaths.clear();
for (std::vector<std::string>::const_iterator prefixIt = prefixes.begin(); for (std::vector<std::string>::const_iterator rootIt = roots.begin();
prefixIt != prefixes.end(); rootIt != roots.end();
++prefixIt ) ++rootIt )
{ {
for (std::vector<std::string>::const_iterator it = unprefixedPaths.begin(); for (std::vector<std::string>::const_iterator it = unrootedPaths.begin();
it != unprefixedPaths.end(); it != unrootedPaths.end();
++it ) ++it )
{ {
std::string prefixedDir=*prefixIt; std::string rootedDir=*rootIt;
prefixedDir+=*it; rootedDir+=*it;
this->SearchPaths.push_back(prefixedDir); this->SearchPaths.push_back(rootedDir);
} }
} }
if (this->FindRootPathMode == RootPathModeBoth) if (this->FindRootPathMode == RootPathModeBoth)
{ {
this->AddPaths(unprefixedPaths); this->AddPaths(unrootedPaths);
} }
} }