summaryrefslogtreecommitdiff
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-12-27 15:33:47 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2005-12-27 15:33:47 -0500
commit552842d11f845ad53e4f34be549aa4007737564b (patch)
tree6724d78898ba2ec28b587394df9e522919d0e8fa /Source/cmLocalUnixMakefileGenerator3.cxx
parent82bb6fae0d127b2ffcaae5eaa8a5365093cfac5c (diff)
downloadcmake-552842d11f845ad53e4f34be549aa4007737564b.tar.gz
ENH: make sure -F is not duplicated
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 1c2493466a..922c94c15f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -513,14 +513,34 @@ cmLocalUnixMakefileGenerator3
#ifndef __APPLE__
return std::string();
#else
+ std::set<cmStdString> emitted;
+ std::vector<std::string> includes;
+ this->GetIncludeDirectories(includes);
+ std::vector<std::string>::iterator i;
+ // check all include directories for frameworks as this
+ // will already have added a -F for the framework
+ for(i = includes.begin(); i != includes.end(); ++i)
+ {
+ if(cmSystemTools::IsPathToFramework(i->c_str()))
+ {
+ std::string frameworkDir = *i;
+ frameworkDir += "/../";
+ frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
+ emitted.insert(frameworkDir);
+ }
+ }
+
std::string flags;
std::vector<std::string>& frameworks = target.GetFrameworks();
- for(std::vector<std::string>::iterator i = frameworks.begin();
+ for(i = frameworks.begin();
i != frameworks.end(); ++i)
{
- flags += "-F";
- flags += this->ConvertToOutputForExisting(i->c_str());
- flags += " ";
+ if(emitted.insert(*i).second)
+ {
+ flags += "-F";
+ flags += this->ConvertToOutputForExisting(i->c_str());
+ flags += " ";
+ }
}
return flags;
#endif