cmFindProgramCommand: Use Names member instead of passing it
This commit is contained in:
parent
bf32b95efe
commit
ed4de3c984
|
@ -41,7 +41,7 @@ bool cmFindProgramCommand
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string result = FindProgram(this->Names);
|
std::string result = FindProgram();
|
||||||
if(result != "")
|
if(result != "")
|
||||||
{
|
{
|
||||||
// Save the value in the cache
|
// Save the value in the cache
|
||||||
|
@ -59,31 +59,30 @@ bool cmFindProgramCommand
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmFindProgramCommand::FindProgram(std::vector<std::string> names)
|
std::string cmFindProgramCommand::FindProgram()
|
||||||
{
|
{
|
||||||
std::string program = "";
|
std::string program = "";
|
||||||
|
|
||||||
if(this->SearchAppBundleFirst || this->SearchAppBundleOnly)
|
if(this->SearchAppBundleFirst || this->SearchAppBundleOnly)
|
||||||
{
|
{
|
||||||
program = FindAppBundle(names);
|
program = FindAppBundle();
|
||||||
}
|
}
|
||||||
if(program.empty() && !this->SearchAppBundleOnly)
|
if(program.empty() && !this->SearchAppBundleOnly)
|
||||||
{
|
{
|
||||||
program = cmSystemTools::FindProgram(names, this->SearchPaths, true);
|
program = cmSystemTools::FindProgram(this->Names, this->SearchPaths, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(program.empty() && this->SearchAppBundleLast)
|
if(program.empty() && this->SearchAppBundleLast)
|
||||||
{
|
{
|
||||||
program = this->FindAppBundle(names);
|
program = this->FindAppBundle();
|
||||||
}
|
}
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmFindProgramCommand
|
std::string cmFindProgramCommand::FindAppBundle()
|
||||||
::FindAppBundle(std::vector<std::string> names)
|
|
||||||
{
|
{
|
||||||
for(std::vector<std::string>::const_iterator name = names.begin();
|
for(std::vector<std::string>::const_iterator name = this->Names.begin();
|
||||||
name != names.end() ; ++name)
|
name != this->Names.end() ; ++name)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string appName = *name + std::string(".app");
|
std::string appName = *name + std::string(".app");
|
||||||
|
|
|
@ -52,11 +52,9 @@ public:
|
||||||
|
|
||||||
cmTypeMacro(cmFindProgramCommand, cmFindBase);
|
cmTypeMacro(cmFindProgramCommand, cmFindBase);
|
||||||
|
|
||||||
protected:
|
|
||||||
std::string FindProgram(std::vector<std::string> names);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string FindAppBundle(std::vector<std::string> names);
|
std::string FindProgram();
|
||||||
|
std::string FindAppBundle();
|
||||||
std::string GetBundleExecutable(std::string bundlePath);
|
std::string GetBundleExecutable(std::string bundlePath);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue