summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-09-24 14:17:45 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-25 21:08:08 (GMT)
commitb64dd760d12ba38de3321d0666f7b0288564d13a (patch)
treec382d3eb3b33137b4ee7aa3d5035745dc4621bb3 /Source/cmFindLibraryCommand.cxx
parent531c71bac3cdd92392e5e225cd03d1001d24347a (diff)
downloadCMake-b64dd760d12ba38de3321d0666f7b0288564d13a.zip
CMake-b64dd760d12ba38de3321d0666f7b0288564d13a.tar.gz
CMake-b64dd760d12ba38de3321d0666f7b0288564d13a.tar.bz2
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.
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r--Source/cmFindLibraryCommand.cxx21
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index a9939dd..d0f7519 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -492,19 +492,22 @@ std::string cmFindLibraryCommand::FindNormalLibrary()
//----------------------------------------------------------------------------
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();
ni != this->Names.end() ; ++ni)
{
- // Search the paths for a framework with this name.
- std::string fwName = *ni;
- fwName += ".framework";
- std::string fwPath = cmSystemTools::FindDirectory(fwName.c_str(),
- this->SearchPaths,
- true);
- if(!fwPath.empty())
+ for(std::vector<std::string>::const_iterator
+ di = this->SearchPaths.begin();
+ di != this->SearchPaths.end(); ++di)
{
- return fwPath;
+ fwPath = *di;
+ fwPath += *ni;
+ fwPath += ".framework";
+ if(cmSystemTools::FileIsDirectory(fwPath.c_str()))
+ {
+ return cmSystemTools::CollapseFullPath(fwPath.c_str());
+ }
}
}