fixed bug and modified functionality
This commit is contained in:
parent
3acd5951ba
commit
7cde8fd0f4
|
@ -40,11 +40,19 @@ bool cmFindProgramCommand::Invoke(std::vector<std::string>& args)
|
|||
m_Makefile->AddDefinition(define, cacheValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
// if it is not in the cache, then search the system path
|
||||
// add any user specified paths
|
||||
std::vector<std::string> path;
|
||||
cmSystemTools::GetPath(path);
|
||||
for(; i != args.end(); ++i)
|
||||
for (unsigned int j = 2; j < args.size(); j++)
|
||||
{
|
||||
// expand variables
|
||||
std::string exp = args[j];
|
||||
m_Makefile->ExpandVariablesInString(exp);
|
||||
path.push_back(exp);
|
||||
}
|
||||
cmSystemTools::GetPath(path);
|
||||
|
||||
for(unsigned int k=0; k < path.size(); k++)
|
||||
{
|
||||
std::string tryPath = path[k];
|
||||
|
@ -63,7 +71,6 @@ bool cmFindProgramCommand::Invoke(std::vector<std::string>& args)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
virtual const char* GetName() { return "FIND_PROGRARM";}
|
||||
virtual const char* GetName() { return "FIND_PROGRAM";}
|
||||
|
||||
/**
|
||||
* Succinct documentation.
|
||||
|
@ -69,7 +69,7 @@ public:
|
|||
virtual const char* GetFullDocumentation()
|
||||
{
|
||||
return
|
||||
"FIND_PROGRAM(NAME executable1 executable2 ...)";
|
||||
"FIND_PROGRAM(NAME executable1 extrapath extrapath ...)";
|
||||
}
|
||||
|
||||
cmTypeMacro(cmFindProgramCommand, cmCommand);
|
||||
|
|
Loading…
Reference in New Issue