forked from Livox-SDK/Livox-SDK2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
143 lines (129 loc) · 4.18 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
137
138
139
140
141
142
143
cmake_minimum_required(VERSION 3.0)
set(SDK_LIBRARY_STATIC livox_lidar_sdk_static)
set(SDK_LIBRARY_SHARED livox_lidar_sdk_shared)
add_library(${SDK_LIBRARY_STATIC} STATIC "")
add_library(${SDK_LIBRARY_SHARED} SHARED "")
set(LIVOX_SDK_MAJOR_VERSION "0")
set(LIVOX_SDK_MINOR_VERSION "0")
set(LIVOX_SDK_PATCH_VERSION "2")
set(LIVOX_SDK_VERSION_STRING "${LIVOX_SDK_MAJOR_VERSION}.${LIVOX_SDK_MINOR_VERSION}.${LIVOX_SDK_PATCH_VERSION}")
set(LIVOX_API_HEADER
../include/livox_lidar_def.h
../include/livox_lidar_api.h
../include/livox_lidar_cfg.h
)
set_target_properties(${SDK_LIBRARY_STATIC} #${SDK_LIBRARY_SHARED}
PROPERTIES
PUBLIC_HEADER "${LIVOX_API_HEADER}"
)
if(WIN32)
set(PLATFORM win)
else(WIN32)
set(PLATFORM unix)
endif (WIN32)
target_compile_options(${SDK_LIBRARY_STATIC}
PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall>#-Wno-c++11-long-long>
PRIVATE $<$<CXX_COMPILER_ID:AppleClang>:-Wno-unknown-pragmas -Wall -Werror -Wno-c++11-long-long>
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wno-unknown-pragmas -Wall -Werror -Wno-c++11-long-long>
)
target_compile_options(${SDK_LIBRARY_SHARED}
PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall>#-Wno-c++11-long-long>
PRIVATE $<$<CXX_COMPILER_ID:AppleClang>:-Wno-unknown-pragmas -Wall -Werror -Wno-c++11-long-long>
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wno-unknown-pragmas -Wall -Werror -Wno-c++11-long-long>
)
set(LIVOX_PRIVATE_INCLUDE_DIR
../3rdparty
../3rdparty/spdlog
.
)
set(LIVOX_PUBLIC_INCLUDE_DIR
../include
)
target_include_directories(
${SDK_LIBRARY_STATIC}
PUBLIC
${LIVOX_PUBLIC_INCLUDE_DIR}
PRIVATE
${LIVOX_PRIVATE_INCLUDE_DIR}
)
target_include_directories(
${SDK_LIBRARY_SHARED}
PUBLIC
${LIVOX_PUBLIC_INCLUDE_DIR}
PRIVATE
${LIVOX_PRIVATE_INCLUDE_DIR}
)
set(MAIN_SOURCES
device_manager.cpp
livox_lidar_sdk.cpp
params_check.cpp
parse_cfg_file.cpp
upgrade_manager.cpp
)
set(BASE_SOURCES
base/io_loop.cpp
base/thread_base.cpp
base/io_thread.cpp
base/logging.cpp
base/network/${PLATFORM}/network_util.cpp
base/multiple_io/multiple_io_base.cpp
base/multiple_io/multiple_io_epoll.cpp
base/multiple_io/multiple_io_poll.cpp
base/multiple_io/multiple_io_select.cpp
base/multiple_io/multiple_io_kqueue.cpp
base/wake_up/${PLATFORM}/wake_up_pipe.cpp
)
set(COMM_SOURCES
comm/comm_port.cpp
comm/sdk_protocol.cpp
comm/generate_seq.cpp
)
set(UPGRADE_SOURCES
upgrade_manager.cpp
upgrade/firmware.cpp
upgrade/livox_lidar_upgrader.cpp
)
set(LOGGER_HANDLER_SOURCES
logger_handler/logger_manager.cpp
logger_handler/logger_handler.cpp
logger_handler/file_manager.cpp
)
set(DATA_HANDLER_SOURCES
data_handler/data_handler.cpp
)
set(COMMAND_HANDLER_SOURCES
command_handler/command_impl.cpp
command_handler/general_command_handler.cpp
command_handler/hap_command_handler.cpp
command_handler/mid360_command_handler.cpp
command_handler/build_request.cpp
command_handler/parse_lidar_state_info.cpp
)
set(DEBUG_POINT_CLOUD_HANDLER_SOURCES
debug_point_cloud_handler/debug_point_cloud_manager.cpp
debug_point_cloud_handler/debug_point_cloud_handler.cpp
)
set(LIVOX_SOURCES
../3rdparty/FastCRC/FastCRC_tables.h
../3rdparty/FastCRC/FastCRCsw.cpp
${MAIN_SOURCES}
${BASE_SOURCES}
${COMM_SOURCES}
${UPGRADE_SOURCES}
${LOGGER_HANDLER_SOURCES}
${DATA_HANDLER_SOURCES}
${COMMAND_HANDLER_SOURCES}
${DEBUG_POINT_CLOUD_HANDLER_SOURCES}
)
target_sources(${SDK_LIBRARY_STATIC}
PRIVATE
${LIVOX_SOURCES}
)
target_sources(${SDK_LIBRARY_SHARED}
PRIVATE
${LIVOX_SOURCES}
)
install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)