-
Notifications
You must be signed in to change notification settings - Fork 31
/
CMakeLists.txt
98 lines (83 loc) · 2.64 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
cmake_minimum_required(VERSION 2.8.3)
project(kinect2_tracker)
# check c++11 / c++0x
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
cmake_modules
cv_bridge
geometry_msgs
image_transport
kdl_conversions
roscpp
roslib
tf
tf_conversions
std_msgs
visualization_msgs
message_generation
)
find_package(Eigen REQUIRED)
find_package(cmake_modules REQUIRED)
link_directories(
${catkin_LIBRARY_DIRS}
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_message_files(
DIRECTORY
msg
FILES
user_IDs.msg
user_points.msg
bounding_box.msg
)
generate_messages(
DEPENDENCIES geometry_msgs std_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES kinect2_tracker
CATKIN_DEPENDS cv_bridge geometry_msgs image_transport kdl_conversions roscpp roslib tf tf_conversions visualization_msgs message_runtime
DEPENDS Eigen
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
)
## Declare a C++ library
add_library(kinect2_tracker
src/kinect2_tracker_node.cpp
)
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(kinect2_tracker ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
set(NITE2_DIR ~/package_ws/NiTE-Linux-x64-2.2/)
set(NITE2_LIB ~/package_ws/NiTE-Linux-x64-2.2/Redist/libNiTE2.so)
include_directories(./include/Openni2/)
include_directories(${NITE2_DIR}/Include)
include_directories(./include)
include_directories(${OpenCV_INCLUDE_DIRS}/include)
add_executable(kinect2_tracker_node src/kinect2_tracker_node.cpp include/kinect2_tracker.hpp include/visualization.hpp)
target_link_libraries(kinect2_tracker_node OpenNI2 ${NITE2_LIB} ${catkin_LIBRARIES} ${Eigen_LIBRARIES})
add_dependencies(kinect2_tracker_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_generate_messages_cpp)