-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
136 lines (115 loc) · 3.62 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
cmake_minimum_required(VERSION 2.8.3)
project(realsense_camera)
# Save the command line compile commands in the build output
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# View the makefile commands during build
#set(CMAKE_VERBOSE_MAKEFILE on)
# Set compile flags
set(CMAKE_CXX_FLAGS "-fPIE -fPIC -std=c++11 -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wformat -Wformat-security -Wall ${CMAKE_CXX_FLAGS}")
# Flags executables
set(CMAKE_EXE_LINKER_FLAGS "-pie -z noexecstack -z relro -z now")
# Flags shared libraries
set(CMAKE_SHARED_LINKER_FLAGS "-z noexecstack -z relro -z now")
find_package(catkin REQUIRED COMPONENTS
#librealsense
dynamic_reconfigure
roscpp
nodelet
cv_bridge
image_transport
camera_info_manager
tf
message_generation
std_msgs
sensor_msgs
rostest
pcl_ros
)
add_message_files(
FILES
IMUInfo.msg
SamplingData.msg
)
add_service_files(
FILES
CameraConfiguration.srv
ForcePower.srv
SetPower.srv
IsPowered.srv
GetIMUInfo.srv
)
generate_messages(
DEPENDENCIES
std_msgs
)
#add dynamic reconfigure api
generate_dynamic_reconfigure_options(
cfg/r200_params.cfg
cfg/f200_params.cfg
cfg/sr300_params.cfg
cfg/zr300_params.cfg
)
#################################
# catkin specific configuration #
#################################
# The catkin_package macro generates cmake config files for your package
# Declare things to be passed to dependent projects
# INCLUDE_DIRS: uncomment this if you package contains header files
# LIBRARIES: libraries you create in this project that dependent projects also need
# CATKIN_DEPENDS: catkin_packages dependent projects also need
# DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS std_msgs message_runtime sensor_msgs
LIBRARIES ${PROJECT_NAME}_nodelet
)
# Specify additional locations of header files
include_directories(
include
${catkin_INCLUDE_DIRS}
)
link_directories(/usr/lib/)
add_library(${PROJECT_NAME}_nodelet src/base_nodelet.cpp src/r200_nodelet.cpp src/f200_nodelet.cpp src/sr300_nodelet.cpp
src/zr300_nodelet.cpp src/base_callback_nodelet.cpp src/lr200m_nodelet.cpp)
target_link_libraries(${PROJECT_NAME}_nodelet
librealsense.so
${catkin_LIBRARIES}
)
add_dependencies(${PROJECT_NAME}_nodelet ${PROJECT_NAME}_generate_messages_cpp ${PROJECT_NAME}_gencfg)
add_dependencies(${PROJECT_NAME}_nodelet ${catkin_EXPORTED_TARGETS})
add_executable(tests_camera_core test/camera_core.cpp)
target_link_libraries(tests_camera_core
${catkin_LIBRARIES}
${GTEST_LIBRARIES}
)
add_dependencies(tests_camera_core ${PROJECT_NAME}_generate_messages_cpp ${PROJECT_NAME}_gencfg)
add_dependencies(tests_camera_core ${catkin_EXPORTED_TARGETS})
add_executable(tests_rgbd_topics test/rgbd_topics.cpp)
target_link_libraries(tests_rgbd_topics
${catkin_LIBRARIES}
${GTEST_LIBRARIES}
)
add_dependencies(tests_rgbd_topics ${PROJECT_NAME}_generate_messages_cpp)
add_dependencies(tests_rgbd_topics ${catkin_EXPORTED_TARGETS})
# Install nodelet library
install(TARGETS ${PROJECT_NAME}_nodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# Install header files
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
# Install launch files
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)
# Install rviz files
install(DIRECTORY rviz/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/rviz
)
# Install xml files
install(FILES nodelet_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)