forked from ros-drivers/openni2_camera
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
118 lines (93 loc) · 3.84 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
106
107
108
109
110
111
112
113
114
115
116
117
cmake_minimum_required(VERSION 2.8.3)
project(openni2_camera)
find_package(catkin REQUIRED COMPONENTS camera_info_manager
dynamic_reconfigure
image_transport
nodelet
sensor_msgs
roscpp
pal_detection_msgs
message_generation
cv_bridge
tf)
find_package(Boost REQUIRED COMPONENTS system thread)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}")
add_definitions(-D__linux__)
find_package(PkgConfig)
pkg_check_modules(PC_OPENNI2 libopenni2)
if (NOT PC_OPENNI2_FOUND)
pkg_check_modules(PC_OPENNI2 REQUIRED openni2)
endif()
find_package(NiTE2 REQUIRED)
generate_dynamic_reconfigure_options(cfg/OpenNI2.cfg)
add_service_files(FILES
GetSerial.srv)
generate_messages()
catkin_package(
INCLUDE_DIRS include
LIBRARIES openni2_wrapper
CATKIN_DEPENDS camera_info_manager dynamic_reconfigure image_transport nodelet sensor_msgs roscpp message_runtime pal_detection_msgs cv_bridge tf
DEPENDS libopenni2
)
include_directories(include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PC_OPENNI2_INCLUDE_DIRS}
${NITE2_INCLUDE_DIRS}
)
link_directories(${PC_OPENNI2_LIBRARY_DIRS})
add_library(openni2_wrapper
src/openni2_convert.cpp
src/openni2_device.cpp
src/openni2_device_info.cpp
src/openni2_timer_filter.cpp
src/openni2_frame_listener.cpp
src/nite2_hand_tracker_frame_listener.cpp
src/nite2_user_tracker_frame_listener.cpp
src/openni2_device_manager.cpp
src/openni2_exception.cpp
src/openni2_video_mode.cpp
)
target_link_libraries(openni2_wrapper ${catkin_LIBRARIES} ${PC_OPENNI2_LIBRARIES} ${Boost_LIBRARIES}
${NITE2_LIBRARIES})
add_executable(test_wrapper test/test_wrapper.cpp )
target_link_libraries(test_wrapper openni2_wrapper ${Boost_LIBRARIES} ${NITE2_LIBRARIES})
add_library(openni2_driver_lib
src/openni2_driver.cpp
)
add_dependencies(openni2_driver_lib pal_detection_msgs_generate_messages_cpp)
target_link_libraries(openni2_driver_lib openni2_wrapper ${catkin_LIBRARIES} ${Boost_LIBRARIES} )
add_dependencies(openni2_driver_lib ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_generate_messages_cpp)
add_library(openni2_camera_nodelet
ros/openni2_camera_nodelet.cpp
)
target_link_libraries(openni2_camera_nodelet openni2_driver_lib ${catkin_LIBRARIES} ${Boost_LIBRARIES} )
add_dependencies(openni2_camera_nodelet ${PROJECT_NAME}_gencfg)
add_executable(openni2_camera_node
ros/openni2_camera_node.cpp
)
target_link_libraries(openni2_camera_node openni2_driver_lib ${catkin_LIBRARIES} ${Boost_LIBRARIES} )
add_dependencies(openni2_camera_node ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_generate_messages_cpp)
add_executable(list_devices
src/list_devices.cpp
)
target_link_libraries(list_devices openni2_wrapper)
if (UNIX AND NOT APPLE)
add_executable(usb_reset src/usb_reset.c)
set(ADDITIONAL_EXECUTABLES "usb_reset")
endif()
install(TARGETS openni2_wrapper openni2_camera_nodelet openni2_camera_node list_devices openni2_driver_lib ${ADDITIONAL_EXECUTABLES}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
# add xml file
install(FILES openni2_nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES etc/NiTE.ini
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/etc
)