From f3890be9d78b0fdaa0601cc95da499b88f236f48 Mon Sep 17 00:00:00 2001 From: Kyle McDonald Date: Mon, 13 Feb 2017 16:03:37 -0800 Subject: [PATCH] remove anaconda from X11_INCLUDE_DIR. closes #437 (#438) --- dlib/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt index 11fb0d86f..5edfac401 100644 --- a/dlib/CMakeLists.txt +++ b/dlib/CMakeLists.txt @@ -243,6 +243,13 @@ if (NOT TARGET dlib) if (NOT DLIB_NO_GUI_SUPPORT) find_package(X11 QUIET) if (X11_FOUND) + # If both X11 and anaconda are installed, it's possible for the + # anaconda path to appear before /opt/X11, so we remove anaconda. + foreach (ITR ${X11_INCLUDE_DIR}) + if ("${ITR}" MATCHES "(.*)anaconda(.*)") + list (REMOVE_ITEM X11_INCLUDE_DIR ${ITR}) + endif () + endforeach(ITR) include_directories(${X11_INCLUDE_DIR}) set (dlib_needed_libraries ${dlib_needed_libraries} ${X11_LIBRARIES}) else()