diff options
author | Brad King <brad.king@kitware.com> | 2006-01-27 23:20:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-01-27 23:20:55 (GMT) |
commit | 938890757aa721ec08909df4870304d5a9405337 (patch) | |
tree | f1120377ca512d92ffb1aad64e5bb59e0d5c699b /Source/cmFindFileCommand.cxx | |
parent | f4b306d5d449b8b5959c2d32898bd9fd23b893c6 (diff) | |
download | CMake-938890757aa721ec08909df4870304d5a9405337.zip CMake-938890757aa721ec08909df4870304d5a9405337.tar.gz CMake-938890757aa721ec08909df4870304d5a9405337.tar.bz2 |
ENH: Improved support for user-configured search paths. Paths given in the CMAKE_LIBRARY_PATH cmake variable are searched first, then those in the CMAKE_LIBRARY_PATH environment variable, then those listed in the call to the FIND_LIBRARY command and finally those listed in the PATH environment variable. The support is similar for finding include files with FIND_PATH, but the variable is CMAKE_INCLUDE_PATH.
Diffstat (limited to 'Source/cmFindFileCommand.cxx')
-rw-r--r-- | Source/cmFindFileCommand.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmFindFileCommand.cxx b/Source/cmFindFileCommand.cxx index 30c481b..daf02dd 100644 --- a/Source/cmFindFileCommand.cxx +++ b/Source/cmFindFileCommand.cxx @@ -60,20 +60,18 @@ bool cmFindFileCommand::InitialPass(std::vector<std::string> const& argsIn) { return true; } - // if it is not in the cache, then search the system path - std::vector<std::string> path; - // add any user specified paths + // The location is not in the cache. Create a search path. + std::vector<std::string> path; + std::vector<std::string> callPaths; for (unsigned int j = 2; j < args.size(); j++) { // Glob the entry in case of wildcards. - cmSystemTools::GlobDirs(args[j].c_str(), path); + cmSystemTools::GlobDirs(args[j].c_str(), callPaths); } + m_Makefile->GetLibrarySearchPath(callPaths, path); - cmSystemTools::GetPath(path, "CMAKE_LIBRARY_PATH"); - - // add the standard path - cmSystemTools::GetPath(path); + // Use the search path to find the file. for(unsigned int k=0; k < path.size(); k++) { std::string tryPath = path[k]; |