summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-08-10 19:28:40 (GMT)
committerAlex Neundorf <neundorf@kde.org>2012-08-16 21:02:10 (GMT)
commitd97b38529efb22579216c406c104c49ea89ba617 (patch)
tree16c657ff3e98e4e86b6bd301a863b3bead7e899c /Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
parentc4306dc8057c45bc5edfd18465f85790800124cd (diff)
downloadCMake-d97b38529efb22579216c406c104c49ea89ba617.zip
CMake-d97b38529efb22579216c406c104c49ea89ba617.tar.gz
CMake-d97b38529efb22579216c406c104c49ea89ba617.tar.bz2
Eclipse on OSX: fix handling of framework include dirs (#13464)
On OSX, the output from gcc looks like this: /usr/include/c++/4.2.1 /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64 /usr/include/c++/4.2.1/backward /usr/lib/gcc/i686-apple-darwin10/4.2.1/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. The "(framework directory)" part needs to be removed so that Eclipse handles it properly Alex
Diffstat (limited to 'Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake')
-rw-r--r--Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 54a6418..1fa0157 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -42,7 +42,10 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
# split the output into lines and then remove leading and trailing spaces from each of them:
string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
foreach(nextLine ${_includeLines})
- string(STRIP "${nextLine}" _includePath)
+ # on OSX, gcc says things like this: "/System/Library/Frameworks (framework directory)", strip the last part
+ string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${nextLine}")
+ # strip spaces at the beginning and the end
+ string(STRIP "${nextLineNoFramework}" _includePath)
list(APPEND ${_resultIncludeDirs} "${_includePath}")
endforeach()