Commit 6bd5c2e3 authored by Davis King's avatar Davis King

Made cmake use the built in find X11 scripts by default on OS X.

parent 63734971
...@@ -148,6 +148,11 @@ if (NOT TARGET dlib) ...@@ -148,6 +148,11 @@ if (NOT TARGET dlib)
set (dlib_needed_libraries ${pthreadlib}) set (dlib_needed_libraries ${pthreadlib})
if (NOT DLIB_NO_GUI_SUPPORT) if (NOT DLIB_NO_GUI_SUPPORT)
find_package(X11 QUIET)
if (X11_FOUND)
include_directories(${X11_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${X11_LIBRARIES})
else()
find_library(xlib X11) find_library(xlib X11)
# Make sure X11 is in the include path. Note that we look for # 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 # Xlocale.h rather than Xlib.h because it avoids finding a partial
...@@ -162,7 +167,10 @@ if (NOT TARGET dlib) ...@@ -162,7 +167,10 @@ if (NOT TARGET dlib)
get_filename_component(x11_path ${xlib_path} PATH CACHE) get_filename_component(x11_path ${xlib_path} PATH CACHE)
include_directories(${x11_path}) include_directories(${x11_path})
set(dlib_needed_libraries ${dlib_needed_libraries} ${xlib} ) set(dlib_needed_libraries ${dlib_needed_libraries} ${xlib} )
else() set(X11_FOUND 1)
endif()
endif()
if (NOT X11_FOUND)
message(" *****************************************************************************") message(" *****************************************************************************")
message(" *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***") message(" *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***")
message(" *** Make sure XQuartz is installed if you want GUI support. ***") message(" *** Make sure XQuartz is installed if you want GUI support. ***")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment