diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-10-09 19:52:29 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-10-09 19:52:29 (GMT) |
commit | 96e8cd82c7e5232d85cf94e1f1ce04ed48c96801 (patch) | |
tree | 77b818f6ccb9e92c37628f2ab4803000035f114f /Source | |
parent | 1e62f2392ced335cc5ae34b6ea6ed869a3f899ae (diff) | |
download | CMake-96e8cd82c7e5232d85cf94e1f1ce04ed48c96801.zip CMake-96e8cd82c7e5232d85cf94e1f1ce04ed48c96801.tar.gz CMake-96e8cd82c7e5232d85cf94e1f1ce04ed48c96801.tar.bz2 |
ENH: put the system path after the paths specified on to the FIND command
Diffstat (limited to 'Source')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 285f792..1af2243 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1016,10 +1016,12 @@ bool SystemTools::RemoveFile(const char* source) kwsys_std::string SystemTools::FindFile(const char* name, const kwsys_std::vector<kwsys_std::string>& userPaths) { - // Add the system search path to our path. - kwsys_std::vector<kwsys_std::string> path = userPaths; + // Add the system search path to our path first + kwsys_std::vector<kwsys_std::string> path; SystemTools::GetPath(path); - + // now add the additional paths + path.insert(path.end(), userPaths.begin(), userPaths.end()); + // now look for the file kwsys_std::string tryPath; for(kwsys_std::vector<kwsys_std::string>::const_iterator p = path.begin(); p != path.end(); ++p) @@ -1065,12 +1067,14 @@ kwsys_std::string SystemTools::FindProgram(const char* name, } // Add the system search path to our path. - kwsys_std::vector<kwsys_std::string> path = userPaths; + kwsys_std::vector<kwsys_std::string> path; if (!no_system_path) { SystemTools::GetPath(path); } - + // now add the additional paths + path.insert(path.end(), userPaths.begin(), userPaths.end()); + for(kwsys_std::vector<kwsys_std::string>::const_iterator p = path.begin(); p != path.end(); ++p) { @@ -1122,9 +1126,10 @@ kwsys_std::string SystemTools::FindLibrary(const char* name, } // Add the system search path to our path. - kwsys_std::vector<kwsys_std::string> path = userPaths; + kwsys_std::vector<kwsys_std::string> path; SystemTools::GetPath(path); - + // now add the additional paths + path.insert(path.end(), userPaths.begin(), userPaths.end()); kwsys_std::string tryPath; for(kwsys_std::vector<kwsys_std::string>::const_iterator p = path.begin(); p != path.end(); ++p) |