forked from HesaiTechnology/HesaiLidar_General_ROS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
117 lines (104 loc) · 2.9 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(hesai_lidar)
# Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
find_package(Boost REQUIRED )
find_package(PCL REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
find_path(YAML_CPP_INCLUDE_DIR NAMES yaml_cpp.h PATHS ${YAML_CPP_INCLUDE_DIRS})
find_library(YAML_CPP_LIBRARY NAMES YAML_CPP PATHS ${YAML_CPP_LIBRARIES})
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
std_msgs
sensor_msgs
message_runtime
image_transport
pcl_conversions
message_generation
)
add_message_files(
FILES
PandarPacket.msg
PandarScan.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
CATKIN_DEPENDS message_runtime
)
###PandarGeneralRaw
add_library(PandarGeneral
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/input.cc
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral_internal.cc
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pcap_reader.cpp
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/src/pandarGeneral.cc
)
target_include_directories(PandarGeneral PRIVATE
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/include
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/
${Boost_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
target_link_libraries(PandarGeneral
${Boost_LIBRARIES}
${PCL_IO_LIBRARIES}
pcap
)
###PandarGeneralSDK
add_library(PandarGeneralSDK SHARED
src/HesaiLidar_General_SDK/src/pandarGeneral_sdk.cc
src/HesaiLidar_General_SDK/src/tcp_command_client.c
src/HesaiLidar_General_SDK/src/util.c
)
target_include_directories(PandarGeneralSDK PRIVATE
src/HesaiLidar_General_SDK/
src/HesaiLidar_General_SDK/include/
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/include
${Boost_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${YAML_CPP_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
target_link_libraries(PandarGeneralSDK
PandarGeneral
${Boost_LIBRARIES}
${PCL_IO_LIBRARIES}
${YAML_CPP_LIBRARIES}
${catkin_LIBRARIES}
pcap
)
###hesai node
add_executable(hesai_lidar_node
src/main.cc
)
target_include_directories(hesai_lidar_node PRIVATE
src/HesaiLidar_General_SDK/include
src/HesaiLidar_General_SDK/src/PandarGeneralRaw/include
${PCL_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
target_link_libraries(hesai_lidar_node
${catkin_LIBRARIES}
${PCL_IO_LIBRARIES}
PandarGeneralSDK
)
install(TARGETS
hesai_lidar_node
PandarGeneral
PandarGeneralSDK
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)
install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
)