1.从github下载源码
git clone https://github.com/davisking/dlib.git
2.编译安装
cd dlib
mkdir build&cd build
cmake ..
cmake --build .
sudo make install
3.编译python环境
cd ..
sudo python3 setup.py install
4.安装后验证
python3
import dlib
5.CMake引用dlib库
find_package(dlib REQUIRED)
include_directories(${dlib_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${dlib_LIBRARIES})