From ebebe660dfb8751e801168e5a2e8efb2acf7854d Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Sun, 12 May 2002 11:32:29 -0400 Subject: [PATCH] ENH: add no_system_path option to FindProgram so that the PATH is ignored --- Source/cmSystemTools.cxx | 8 ++++++-- Source/cmSystemTools.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 43924b6f27..0eaaed5ee6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1428,7 +1428,8 @@ std::string cmSystemTools::FindFile(const char* name, * found. Otherwise, the empty string is returned. */ std::string cmSystemTools::FindProgram(const char* name, - const std::vector& userPaths) + const std::vector& userPaths, + bool no_system_path) { // See if the executable exists as written. if(cmSystemTools::FileExists(name) && @@ -1446,7 +1447,10 @@ std::string cmSystemTools::FindProgram(const char* name, // Add the system search path to our path. std::vector path = userPaths; - cmSystemTools::GetPath(path); + if (!no_system_path) + { + cmSystemTools::GetPath(path); + } for(std::vector::const_iterator p = path.begin(); p != path.end(); ++p) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 62d55682bf..df12513453 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -220,7 +220,8 @@ public: ///! Find an executable in the system PATH, with optional extra paths. static std::string FindProgram(const char* name, - const std::vector& path= std::vector()); + const std::vector& path = std::vector(), + bool no_system_path = false); ///! Find a library in the system PATH, with optional extra paths. static std::string FindLibrary(const char* name,