aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-11-10 19:47:59 -0800
committerGuy Harris <guy@alum.mit.edu>2014-11-11 03:48:56 +0000
commitb2c2debd978518c5c39781567a0e00f6713cc94e (patch)
tree3b8a67524c54c72a2d8ea7b9bfef02c1008e5baf /cmake
parentafae2b64e2aab4d63ccef3c652507e747594ea93 (diff)
Fix a problem that causes build failures with CMake on Yosemite.
Change-Id: I52e81656470df887eb3c53b2632bf5a310b1b063 Reviewed-on: https://code.wireshark.org/review/5229 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindM.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/modules/FindM.cmake b/cmake/modules/FindM.cmake
index f0779bffff..414ededbff 100644
--- a/cmake/modules/FindM.cmake
+++ b/cmake/modules/FindM.cmake
@@ -12,7 +12,27 @@ IF (M_INCLUDE_DIRS)
SET(M_FIND_QUIETLY TRUE)
ENDIF (M_INCLUDE_DIRS)
+#
+# On OS X, make sure we do *NOT* find math.h in the Kernel framework,
+# as that will convince CMake to cause the build to look there for
+# headers.
+#
+# For some unknown reason, on Yosemite, math.h is included in the Kernel
+# framework. That framework exists to supply headers for building
+# *kernel* modules; it includes versions of C headers that are similar
+# to the standard userland headers, but not similar enough to be usable
+# when building userland code.
+#
+# Unless told not to look first in the framework paths, CMake will, on
+# Yosemite, or when using the Yosemite SDK, find math.h in the Kernel
+# framework, and add the header directory for the Kernel framework to
+# the list of places to look for headers, causing it to pick up other
+# headers from there as well. This causes the build to fail.
+#
+SET(SAVED_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
+SET(CMAKE_FIND_FRAMEWORK LAST)
FIND_PATH(M_INCLUDE_DIR math.h)
+SET(CMAKE_FIND_FRAMEWORK ${SAVED_CMAKE_FIND_FRAMEWORK})
SET(M_NAMES m)
FIND_LIBRARY(M_LIBRARY NAMES ${M_NAMES} )