-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
49 lines (40 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.5)
project(face_track LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS "-Wall -pthread")
set(CMAKE_C_FLAGS_DEBUG "-g -O0")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++17 -lstdc++")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
find_package(OpenCV REQUIRED)
add_library(NCNN SHARED IMPORTED)
set_target_properties(NCNN PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/ncnn-20210720-ubuntu-2004-shared/lib/libncnn.so)
include_directories(
${OpenCV_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/ncnn-20210720-ubuntu-2004-shared/include/ncnn
${CMAKE_SOURCE_DIR}
)
add_executable(
${PROJECT_NAME}
${CMAKE_SOURCE_DIR}/main.cpp
${CMAKE_SOURCE_DIR}/face_tracker.cpp
${CMAKE_SOURCE_DIR}/detection/face_detector.cpp
${CMAKE_SOURCE_DIR}/face_feature/face_feature.cpp
${CMAKE_SOURCE_DIR}/face_modeling/face_landmark.cpp
${CMAKE_SOURCE_DIR}/face_modeling/vanila_model.cpp
${CMAKE_SOURCE_DIR}/track/Hungarian.cpp
${CMAKE_SOURCE_DIR}/track/kalman.cpp
${CMAKE_SOURCE_DIR}/track/metrics.cpp
${CMAKE_SOURCE_DIR}/track/PoseEstimation.cpp
${CMAKE_SOURCE_DIR}/track/tracker.cpp
)
target_link_libraries(
${PROJECT_NAME}
${OpenCV_LIBS}
NCNN
stdc++fs
-ldl
)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)