-
Notifications
You must be signed in to change notification settings - Fork 97
/
CMakeLists.txt
104 lines (82 loc) · 2.93 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
cmake_minimum_required(VERSION 2.8.3)
project(attention_tracker)
set(CMAKE_POSITION_INDEPENDENT_CODE True)
add_definitions(-std=c++11)
set(DLIB_PATH "" CACHE PATH "Path to DLIB")
include(${DLIB_PATH}/dlib/cmake)
option(DEBUG "Enable debug visualizations" ON)
option(WITH_TESTS "Compile sample test application" ON)
option(WITH_ROS "Build ROS nodes -- Requires OpenCV2!" OFF)
include_directories(${OpenCV_INCLUDE_DIRS})
if(WITH_ROS)
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
std_msgs
visualization_msgs
sensor_msgs
cv_bridge
image_transport
image_geometry
)
include_directories(${catkin_INCLUDE_DIRS})
catkin_package(
CATKIN_DEPENDS
tf
DEPENDS OpenCV
LIBRARIES
)
endif()
if(DEBUG)
find_package(OpenCV COMPONENTS core imgproc calib3d highgui REQUIRED)
else()
find_package(OpenCV COMPONENTS core imgproc calib3d REQUIRED)
endif()
message(STATUS "OpenCV version: ${OpenCV_VERSION}")
if(${OpenCV_VERSION} VERSION_GREATER 2.9.0)
set(OPENCV3 TRUE)
add_definitions(-DOPENCV3)
endif()
if(DEBUG)
add_definitions(-DHEAD_POSE_ESTIMATION_DEBUG)
endif()
add_library(head_pose_estimation SHARED src/head_pose_estimation.cpp)
target_link_libraries(head_pose_estimation dlib ${OpenCV_LIBRARIES})
if(WITH_ROS)
add_executable(estimate_focus src/estimate_focus.cpp)
target_link_libraries(estimate_focus ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
add_executable(estimate src/head_pose_estimation_ros.cpp src/ros_head_pose_estimator.cpp)
target_link_libraries(estimate head_pose_estimation ${catkin_LIBRARIES})
install(TARGETS estimate_focus head_pose_estimation estimate
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(PROGRAMS src/withmeness.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES
launch/attention_tracking.launch
calib/logitech-c920_640x360.ini
share/shape_predictor_68_face_landmarks.dat
share/targets.json
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
endif()
if(WITH_TESTS)
if(OPENCV3)
if (DEBUG)
find_package(OpenCV COMPONENTS core imgproc calib3d highgui imgcodecs videoio REQUIRED)
else()
find_package(OpenCV COMPONENTS core imgproc calib3d imgcodecs videoio REQUIRED)
endif()
else()
find_package(OpenCV COMPONENTS core imgproc calib3d highgui REQUIRED)
endif()
add_executable(head_pose_single_frame samples/head_pose_estimation_single_frame.cpp)
target_link_libraries(head_pose_single_frame head_pose_estimation ${OpenCV_LIBRARIES})
if(DEBUG)
add_executable(head_pose_test samples/head_pose_estimation_test.cpp)
target_link_libraries(head_pose_test head_pose_estimation ${OpenCV_LIBRARIES})
endif()
endif()