summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2012-09-22 02:10:49 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2012-09-22 02:10:49 -0400
commitaa57ad608235fa86dec794beaac50fa0f78bf4cb (patch)
tree723730dc0784e71b9c133e7cbfae3d46688d6789 /CMakeLists.txt
parent097893bfbfba59f71dec2811e9a2d13ca953043b (diff)
Fix issues with CMake trying to add /System/Library/Frameworks/Kernel.framework/Headers/sys to the include paths.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fabdb7e4c..5e0da5f0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -132,6 +132,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
string(LENGTH ${LINE} LINE_LENGTH)
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
+ # For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
+ string(FIND ${INCLUDE} " (framework directory)" FRAMEWORK)
+ if(NOT FRAMEWORK EQUAL -1)
+ string(SUBSTRING ${INCLUDE} 0 ${FRAMEWORK} INCLUDE)
+ endif(NOT FRAMEWORK EQUAL -1)
# Convert the path to an absolute one, just in case it wasn't
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
# Add that directory to the list of default include directories