diff options
author | Brad King <brad.king@kitware.com> | 2008-06-09 19:08:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-06-09 19:08:59 (GMT) |
commit | 5b406c9044772ab56632edf6824759210c28f1c4 (patch) | |
tree | c66a888964f44ebf08b4ca9f55fafda44484e5b9 /Source/cmFindCommon.cxx | |
parent | 2cadc9138fc405fe49fb3f8cb4153b9c20c95df6 (diff) | |
download | CMake-5b406c9044772ab56632edf6824759210c28f1c4.zip CMake-5b406c9044772ab56632edf6824759210c28f1c4.tar.gz CMake-5b406c9044772ab56632edf6824759210c28f1c4.tar.bz2 |
ENH: Add HINTS option to find_* commands.
- Hints are searched after user locations but before system locations
- The HINTS option should have paths provided by system introspection
- The PATHS option should have paths that are hard-coded guesses
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r-- | Source/cmFindCommon.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index d69fdce..45ee91a 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -76,14 +76,14 @@ cmFindCommon::cmFindCommon() "then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH " "is used then only the re-rooted directories will be searched.\n"; this->GenericDocumentationPathsOrder = - "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 " - "first in the locations specified by their environment. Projects may " - "override this behavior by simply calling the command twice:\n" + "The default search order is designed to be most-specific to " + "least-specific for common use cases. " + "Projects may override the order by simply calling the command " + "multiple times and using the NO_* options:\n" " FIND_XXX(FIND_ARGS_XXX PATHS paths... NO_DEFAULT_PATH)\n" " FIND_XXX(FIND_ARGS_XXX)\n" - "Once one of these calls succeeds the result variable will be set " - "and stored in the cache so that neither call will search again."; + "Once one of the calls succeeds the result variable will be set " + "and stored in the cache so that no call will search again."; } //---------------------------------------------------------------------------- @@ -322,7 +322,8 @@ void cmFindCommon::AddPathSuffix(std::string const& arg) } //---------------------------------------------------------------------------- -void cmFindCommon::AddUserPath(std::string const& p) +void cmFindCommon::AddUserPath(std::string const& p, + std::vector<std::string>& paths) { // We should view the registry as the target application would view // it. @@ -341,7 +342,7 @@ void cmFindCommon::AddUserPath(std::string const& p) // Expand using the view of the target application. std::string expanded = p; cmSystemTools::ExpandRegistryValues(expanded, view); - cmSystemTools::GlobDirs(expanded.c_str(), this->UserPaths); + cmSystemTools::GlobDirs(expanded.c_str(), paths); // Executables can be either 32-bit or 64-bit, so expand using the // alternative view. @@ -349,7 +350,7 @@ void cmFindCommon::AddUserPath(std::string const& p) { expanded = p; cmSystemTools::ExpandRegistryValues(expanded, other_view); - cmSystemTools::GlobDirs(expanded.c_str(), this->UserPaths); + cmSystemTools::GlobDirs(expanded.c_str(), paths); } } |