【Dlib】在项目中同时导入Dlib库和OpenCV库

来源:互联网 发布:帝国cms支付 编辑:程序博客网 时间:2024/06/08 19:29

为知笔记原生链接:http://8d4a0fd3.wiz03.com/share/s/2diw_j37l4Wf2MIAMf0jlWZx2F1QNo1V5QU82ZBLJz3p2uZx

# cmake needs this linecmake_minimum_required(VERSION 2.8.12)# Define project nameproject(example_project)# Find OpenCV, you may need to set OpenCV_DIR variable# to the absolute path to the directory containing OpenCVConfig.cmake file# via the command line or GUIfind_package(OpenCV REQUIRED)# If the package has been found, several variables will# be set, you can find the full list with descriptions# in the OpenCVConfig.cmake file.# Print some message showing some of themmessage(STATUS "OpenCV library status:")message(STATUS "    version: ${OpenCV_VERSION}")message(STATUS "    libraries: ${OpenCV_LIBS}")message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")# Find dlib, you may need to set dlib_DIR variable# to the absolute path to the directory containing dlibConfig.cmake file# via the command line or GUIfind_package(dlib REQUIRED)# If the package has been found, several variables will# be set, you can find the full list with descriptions# in the dlibConfig.cmake file.# Print some message showing some of themmessage(STATUS "Dlib library status:")message(STATUS "    version: ${dlib_VERSION}")message(STATUS "    libraries: ${dlib_LIBRARIES}")message(STATUS "    include path: ${dlib_INCLUDE_DIRS}")# Add OpenCV headers location to your include pathsinclude_directories(${OpenCV_INCLUDE_DIRS})# Add dlib headers location to your include pathsinclude_directories(${dlib_INCLUDE_DIRS})# Declare the executable target built from your sourcesadd_executable(example example.cpp)# Link your application with OpenCV librariestarget_link_libraries(example ${dlib_LIBRARIES} ${OpenCV_LIBS})