--- a/dlib/CMakeLists.txt
+++ b/dlib/CMakeLists.txt
@@ -49,6 +49,7 @@
    endif()
 endif()

+find_package(pybind11 REQUIRED)

 if (COMMAND pybind11_add_module AND MSVC)
    # True when building a python extension module using Visual Studio.  We care
--- a/tools/python/CMakeLists.txt
+++ b/tools/python/CMakeLists.txt
@@ -35,7 +35,8 @@
     include(${CMAKE_CURRENT_LIST_DIR}/../../dlib/cmake_utils/tell_visual_studio_to_use_static_runtime.cmake)
 endif()

-add_subdirectory(../../dlib/external/pybind11 pybind11_build)
+#add_subdirectory(../../dlib/external/pybind11 pybind11_build)
+find_package(pybind11 REQUIRED)
 add_subdirectory(../../dlib dlib_build)

 add_definitions(-DDLIB_VERSION=${DLIB_VERSION})

