-
Notifications
You must be signed in to change notification settings - Fork 63
/
CMakeLists.txt
105 lines (90 loc) · 2.25 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
105
cmake_minimum_required(VERSION 2.8.3)
project(ros_openpose)
## Compile as C++11, supported in ROS Kinetic and newer
add_definitions(-std=c++11)
## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
cv_bridge
std_msgs
sensor_msgs
image_transport
message_generation
)
## Make sure 'FindGFlags.cmake' and 'FindGlog.cmake' are visible to cmake
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
## Add OpenPose and other dependencies
find_package(GFlags)
find_package(Glog)
find_package(OpenCV REQUIRED)
find_package(OpenPose REQUIRED)
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
## Pass in the version of OpenPose
add_definitions( -DOpenPose_VERSION_MAJOR=${OpenPose_VERSION_MAJOR} )
add_definitions( -DOpenPose_VERSION_MINOR=${OpenPose_VERSION_MINOR} )
add_definitions( -DOpenPose_VERSION_PATCH=${OpenPose_VERSION_PATCH} )
MESSAGE(STATUS "OpenPose VERSION: " ${OpenPose_VERSION})
## Declare ROS messages
add_message_files(
FILES
Pixel.msg
BodyPart.msg
Person.msg
Frame.msg
)
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
)
# catkin specific configuration
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
std_msgs
geometry_msgs
message_runtime
)
## Build
# Specify additional locations of header files
include_directories(
include
${OpenPose_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIR}
${GLOG_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
link_directories(
${catkin_LIBRARY_DIRS}
)
## Path to Caffe lib i.e., libcaffe.so
## find /home/ravi/tools/openpose -name libcaffe.so
#set(CAFFE_LIB_FOLDER /home/ravi/tools/openpose/build/caffe/lib)
#link_directories(${CAFFE_LIB_FOLDER})
# Declare a C++ executable and
# specify libraries to link a executable target against
add_executable(rosOpenpose
src/rosOpenpose.cpp
src/cameraReader.cpp)
target_link_libraries(rosOpenpose
${OpenPose_LIBS}
${GFLAGS_LIBRARY}
${GLOG_LIBRARY}
${OpenCV_LIBS}
${catkin_LIBRARIES}
)
add_executable(testCameraReader
src/testCameraReader.cpp
src/cameraReader.cpp)
target_link_libraries(testCameraReader
${OpenPose_LIBS}
${GFLAGS_LIBRARY}
${GLOG_LIBRARY}
${OpenCV_LIBS}
${catkin_LIBRARIES}
)