From 1ad05f9e6d423187b4426be6117820cb791e86ba Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Sun, 12 May 2002 11:31:45 -0400 Subject: ENH/FIX: add NO_SYSTEM_PATH option + fix command usage --- Source/cmFindProgramCommand.cxx | 9 ++++++++- Source/cmFindProgramCommand.h | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 3d24899..c675973 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -76,6 +76,7 @@ bool cmFindProgramCommand::InitialPass(std::vector const& argsIn) bool foundName = false; bool foundPath = false; bool doingNames = true; + bool no_system_path = false; for (unsigned int j = 1; j < args.size(); ++j) { if(args[j] == "NAMES") @@ -88,6 +89,10 @@ bool cmFindProgramCommand::InitialPass(std::vector const& argsIn) doingNames = false; foundPath = true; } + else if (args[j] == "NO_SYSTEM_PATH") + { + no_system_path = true; + } else { if(doingNames) @@ -123,7 +128,9 @@ bool cmFindProgramCommand::InitialPass(std::vector const& argsIn) i != names.end() ; ++i) { // Try to find the program. - std::string result = cmSystemTools::FindProgram(i->c_str(), path); + std::string result = cmSystemTools::FindProgram(i->c_str(), + path, + no_system_path); if(result != "") { // Save the value in the cache diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index ae21338..1fff696 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -70,11 +70,12 @@ public: virtual const char* GetFullDocumentation() { return - "FIND_PROGRAM(NAME executable1 extrapath extrapath ... [DOC helpstring]) " + "FIND_PROGRAM(DEFINE_NAME executableName [NAMES name1 name2 name3...] [PATHS path1 path2 path3...] [NO_SYSTEM_PATH] [DOC helpstring]) " "Find the executable in the system PATH or in any extra paths specified in the command." - "A cache entry called NAME is created to store the result. NOTFOUND is the value" + "A cache entry called DEFILE_NAME is created to store the result. NOTFOUND is the value" " used if the program was not found. If DOC is specified the next argument is the " - "documentation string for the cache entry NAME."; + "documentation string for the cache entry NAME." + "If NO_SYSTEM_PATH is specified the contents of system PATH is not used"; } cmTypeMacro(cmFindProgramCommand, cmCommand); -- cgit v0.12