summaryrefslogtreecommitdiffstats
path: root/Source/cmOrderDirectories.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmOrderDirectories.cxx')
-rw-r--r--Source/cmOrderDirectories.cxx45
1 files changed, 41 insertions, 4 deletions
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 6e41768..93885b2 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -36,8 +36,25 @@ public:
OD(od), GlobalGenerator(od->GlobalGenerator)
{
this->FullPath = file;
- this->Directory = cmSystemTools::GetFilenamePath(file);
- this->FileName = cmSystemTools::GetFilenameName(file);
+
+ if(file.rfind(".framework") != std::string::npos)
+ {
+ cmsys::RegularExpression splitFramework;
+ splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$");
+ if(splitFramework.find(file) &&
+ (splitFramework.match(2) == splitFramework.match(3)))
+ {
+ this->Directory = splitFramework.match(1);
+ this->FileName =
+ std::string(file.begin() + this->Directory.size() + 1, file.end());
+ }
+ }
+
+ if(this->FileName.empty())
+ {
+ this->Directory = cmSystemTools::GetFilenamePath(file);
+ this->FileName = cmSystemTools::GetFilenameName(file);
+ }
}
virtual ~cmOrderDirectoriesConstraint() {}
@@ -301,22 +318,42 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
// Add the runtime library at most once.
if(this->EmmittedConstraintSOName.insert(fullPath).second)
{
+ std::string soname2 = soname ? soname : "";
// Implicit link directories need special handling.
if(!this->ImplicitDirectories.empty())
{
std::string dir = cmSystemTools::GetFilenamePath(fullPath);
+
+ if(fullPath.rfind(".framework") != std::string::npos)
+ {
+ cmsys::RegularExpression splitFramework;
+ splitFramework.compile("^(.*)/(.*).framework/(.*)/(.*)$");
+ if(splitFramework.find(fullPath) &&
+ (splitFramework.match(2) == splitFramework.match(4)))
+ {
+ dir = splitFramework.match(1);
+ soname2 = splitFramework.match(2);
+ soname2 += ".framework/";
+ soname2 += splitFramework.match(3);
+ soname2 += "/";
+ soname2 += splitFramework.match(4);
+ }
+ }
+
if(this->ImplicitDirectories.find(dir) !=
this->ImplicitDirectories.end())
{
this->ImplicitDirEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
+ new cmOrderDirectoriesConstraintSOName(this, fullPath,
+ soname2.c_str()));
return;
}
}
// Construct the runtime information entry for this library.
this->ConstraintEntries.push_back(
- new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
+ new cmOrderDirectoriesConstraintSOName(this, fullPath,
+ soname2.c_str()));
}
else
{