summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-10 17:08:55 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-10 17:08:55 (GMT)
commit33c891f8d8e43dcd4e16b81861d29fc3b198819e (patch)
tree2b3ecc182ae0d4dc7c5bbf7d46aa70d24a81a6e9 /Source/kwsys
parent9c64a178459a735ddcf7eca873a6ce1587875ddd (diff)
downloadCMake-33c891f8d8e43dcd4e16b81861d29fc3b198819e.zip
CMake-33c891f8d8e43dcd4e16b81861d29fc3b198819e.tar.gz
CMake-33c891f8d8e43dcd4e16b81861d29fc3b198819e.tar.bz2
ENH: Add another signature to FindProgram that matches more to the one from CMake
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx16
-rw-r--r--Source/kwsys/SystemTools.hxx.in5
2 files changed, 21 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index df8f137..a306888 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1947,6 +1947,22 @@ kwsys_stl::string SystemTools::FindProgram(
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
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 39b5234..bdc327b 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -493,6 +493,11 @@ public:
const kwsys_stl::vector<kwsys_stl::string>& path =
kwsys_stl::vector<kwsys_stl::string>(),
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