ENH: Add another signature to FindProgram that matches more to the one from CMake

This commit is contained in:
Andy Cedilnik 2005-12-10 12:08:55 -05:00
parent 9c64a17845
commit 33c891f8d8
2 changed files with 21 additions and 0 deletions

View File

@ -1947,6 +1947,22 @@ kwsys_stl::string SystemTools::FindProgram(
return ""; return "";
} }
kwsys_stl::string SystemTools::FindProgram(
const kwsys_stl::vector<kwsys_stl::string>& names,
const kwsys_stl::vector<kwsys_stl::string>& path,
bool noSystemPath)
{
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator it = names.begin();
it != names.end() ; ++it)
{
// Try to find the program.
std::string result = SystemTools::FindProgram(it->c_str(),
path,
noSystemPath);
return result;
}
return "";
}
/** /**
* Find the library with the given name. Searches the given path and then * Find the library with the given name. Searches the given path and then

View File

@ -493,6 +493,11 @@ public:
const kwsys_stl::vector<kwsys_stl::string>& path = const kwsys_stl::vector<kwsys_stl::string>& path =
kwsys_stl::vector<kwsys_stl::string>(), kwsys_stl::vector<kwsys_stl::string>(),
bool no_system_path = false); bool no_system_path = false);
static kwsys_stl::string FindProgram(
const kwsys_stl::vector<kwsys_stl::string>& names,
const kwsys_stl::vector<kwsys_stl::string>& path =
kwsys_stl::vector<kwsys_stl::string>(),
bool no_system_path = false);
/** /**
* Find a library in the system PATH, with optional extra paths * Find a library in the system PATH, with optional extra paths