find_library: Simplify framework search logic
In cmFindLibraryCommand::FindFrameworkLibrary drop use of the old SystemTools::FindDirectory method. Replace it with a direct implementation of the only code path we used.
This commit is contained in:
parent
531c71bac3
commit
b64dd760d1
|
@ -492,19 +492,22 @@ std::string cmFindLibraryCommand::FindNormalLibrary()
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmFindLibraryCommand::FindFrameworkLibrary()
|
std::string cmFindLibraryCommand::FindFrameworkLibrary()
|
||||||
{
|
{
|
||||||
// Search for a framework of each name in the entire search path.
|
std::string fwPath;
|
||||||
|
// Search for each name in all search paths.
|
||||||
for(std::vector<std::string>::const_iterator ni = this->Names.begin();
|
for(std::vector<std::string>::const_iterator ni = this->Names.begin();
|
||||||
ni != this->Names.end() ; ++ni)
|
ni != this->Names.end() ; ++ni)
|
||||||
{
|
{
|
||||||
// Search the paths for a framework with this name.
|
for(std::vector<std::string>::const_iterator
|
||||||
std::string fwName = *ni;
|
di = this->SearchPaths.begin();
|
||||||
fwName += ".framework";
|
di != this->SearchPaths.end(); ++di)
|
||||||
std::string fwPath = cmSystemTools::FindDirectory(fwName.c_str(),
|
|
||||||
this->SearchPaths,
|
|
||||||
true);
|
|
||||||
if(!fwPath.empty())
|
|
||||||
{
|
{
|
||||||
return fwPath;
|
fwPath = *di;
|
||||||
|
fwPath += *ni;
|
||||||
|
fwPath += ".framework";
|
||||||
|
if(cmSystemTools::FileIsDirectory(fwPath.c_str()))
|
||||||
|
{
|
||||||
|
return cmSystemTools::CollapseFullPath(fwPath.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue