1 Star 0 Fork 0

AILearn/NcnnFaceTrack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
张玉虎 提交于 2022-02-25 12:14 . 更新文件目录
# 这个是cmake最小版本要求
cmake_minimum_required(VERSION 3.1)
# Enable C++11,这一段是源码里的
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# 填写你的项目名称Project
project( NcnnFaceTrack )
# 填写target
set(TARGET "NcnnFaceTrack")
# 这一句是寻找你的OpenCV位置
find_package( OpenCV REQUIRED )
# 可以选择将一些信息打印出来,也可以不打印
# 依次为OpenCV位置,版本,库,包含路径
message(STATUS "OpenCV library status:")
message(STATUS "config: ${OpenCV_DIR}")
message(STATUS "version: ${OpenCV_VERSION}")
message(STATUS "librarier: ${OpenCV_LIBS}")
message(STATUS "include path: ${OpenCV_INCLUDE_DIRS}")
# 添加包含目录
aux_source_directory(${CMAKE_SOURCE_DIR}/src DIR_SRCS)
aux_source_directory(${CMAKE_SOURCE_DIR}/src/face DIR_SRCS)
aux_source_directory(${CMAKE_SOURCE_DIR}/src/mtcnn DIR_SRCS)
# 头文件
include_directories(
${OpenCV_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/face
${CMAKE_SOURCE_DIR}/src/mtcnn
${CMAKE_SOURCE_DIR}/src/third_party/ncnn/include
)
# libs
link_directories(
${CMAKE_SOURCE_DIR}/src/third_party/ncnn/lib
)
add_executable(${TARGET} ${DIR_SRCS})
# 填项目名
message(STATUS "OpenCV_LIBS path: ${OpenCV_LIBS}")
target_link_libraries(
${TARGET}
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs opencv_videoio opencv_video
ncnn pthread
)
# Build commands
add_custom_command(
TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TARGET} "../release/${TARGET}"
COMMAND ${CMAKE_COMMAND} -E copy "../data/*" "../release/"
COMMAND ${CMAKE_COMMAND} -E copy "../models/ncnn/*" "../release/"
COMMENT "copy ${TARGET} to ../release/${PLATFORM}/${TARGET}"
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/AILearnRelated/NcnnFaceTrack.git
git@gitee.com:AILearnRelated/NcnnFaceTrack.git
AILearnRelated
NcnnFaceTrack
NcnnFaceTrack
master

搜索帮助