Eclipse on OSX: improve handling of framework include dirs (#13367)

It seems that if cmake finds something like the following:
/System/Library/Frameworks/GLUT.framework/Headers
Eclipse doesn't like that and wants to have
/System/Library/Frameworks
instead

Alex
This commit is contained in:
Alex Neundorf 2012-08-10 21:45:03 +02:00
parent d97b38529e
commit 9110d0eab4
1 changed files with 10 additions and 0 deletions

View File

@ -610,6 +610,16 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
if (!inc->empty())
{
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str());
// handle framework include dirs on OSX, the remainder after the
// Frameworks/ part has to be stripped
// /System/Library/Frameworks/GLUT.framework/Headers
cmsys::RegularExpression frameworkRegex("(.+/Frameworks)/.+\\.framework/");
if(frameworkRegex.find(dir.c_str()))
{
dir = frameworkRegex.match(1);
}
if(emittedDirs.find(dir) == emittedDirs.end())
{
emittedDirs.insert(dir);