From 33c891f8d8e43dcd4e16b81861d29fc3b198819e Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Sat, 10 Dec 2005 12:08:55 -0500 Subject: ENH: Add another signature to FindProgram that matches more to the one from CMake --- Source/kwsys/SystemTools.cxx | 16 ++++++++++++++++ Source/kwsys/SystemTools.hxx.in | 5 +++++ 2 files changed, 21 insertions(+) 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& names, + const kwsys_stl::vector& path, + bool noSystemPath) +{ + for(kwsys_stl::vector::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& path = kwsys_stl::vector(), bool no_system_path = false); + static kwsys_stl::string FindProgram( + const kwsys_stl::vector& names, + const kwsys_stl::vector& path = + kwsys_stl::vector(), + bool no_system_path = false); /** * Find a library in the system PATH, with optional extra paths -- cgit v0.12