From 9110d0eab4ed3b024ad485eaaf15b1d7e4c38744 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Fri, 10 Aug 2012 21:45:03 +0200 Subject: [PATCH] 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 --- Source/cmExtraEclipseCDT4Generator.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 5c7d4002f6..99ca375ece 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -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);