From f2868add0158bc1b2846dc873a0a9b170af55d53 Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 26 Aug 2015 20:28:19 -0400 Subject: [PATCH] Improved finding of X11 on mac os --- dlib/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt index 71e680c86..09ddfaffa 100644 --- a/dlib/CMakeLists.txt +++ b/dlib/CMakeLists.txt @@ -145,10 +145,13 @@ if (NOT TARGET dlib) if (NOT DLIB_NO_GUI_SUPPORT) find_library(xlib X11) - # make sure X11 is in the include path - find_path(xlib_path Xlib.h + # Make sure X11 is in the include path. Note that we look for + # Xlocale.h rather than Xlib.h because it avoids finding a partial + # copy of the X11 headers on systems with anaconda installed. + find_path(xlib_path Xlocale.h PATHS /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include + /opt/local/include PATH_SUFFIXES X11 ) if (xlib AND xlib_path)