From c9213fbb02ddf090448114d9f8a11a15d3380ecb Mon Sep 17 00:00:00 2001 From: Andy Cedilnik <andy.cedilnik@kitware.com> Date: Sat, 10 Dec 2005 12:08:55 -0500 Subject: [PATCH] ENH: Add another signature to FindProgram that matches more to the one from CMake --- SystemTools.cxx | 16 ++++++++++++++++ SystemTools.hxx.in | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/SystemTools.cxx b/SystemTools.cxx index 4e1470d..7036537 100644 --- a/SystemTools.cxx +++ b/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/SystemTools.hxx.in b/SystemTools.hxx.in index 5c73b27..9f341c7 100644 --- a/SystemTools.hxx.in +++ b/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 -- GitLab