-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
109 lines (84 loc) · 2.49 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
cmake_minimum_required(VERSION 2.8)
project(hesaiLidarSDK)
find_package(Boost REQUIRED )
find_package(PCL REQUIRED )
set (LINK_LIBRARY_PLUS "")
if(ENABLE_SAMPLE)
option(Camera_Enable "Enable Camera Driver, For Pandora" ON)
else(NOT ENABLE_SAMPLE)
option(Camera_Enable "Enable Camera Driver, For Pandora" OFF)
endif()
option(Debug_Enable "Enable Camera Driver, For Pandora" OFF)
set (CMAKE_CXX_FLAGS "-fPIC -std=c++11")
set (CMAKE_CXX_STANDARD 11)
set (SRC
src/calibration.cc
src/input.cc
src/rawdata.cc
src/hesaiLidarSDK_IN.cc
src/hesaiLidarSDK.cc
)
#add_custom_target(build-time-make-directory ALL
# COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib)
#message (STATUS "Target library dir == ${CMAKE_BINARY_DIR}/lib")
#message (STATUS "build-time-make-directory == ${build-time-make-directory}")
add_subdirectory(src/pandora_camera_client)
if(Camera_Enable)
message("Build Camera")
find_package( OpenCV REQUIRED )
add_definitions("-DHESAI_WITH_CAMERA")
set (LINK_LIBRARY_PLUS "${OpenCV_LIBS}")
set (JPEG_LIB "jpeg")
set (SRC
${SRC}
src/utilities.cc
)
endif(Camera_Enable)
if(Debug_Enable)
message("Build Debug")
add_definitions("-DDebug")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif(Debug_Enable)
include_directories(
include
src/pandora_camera_client/include
${Boost_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_library( ${PROJECT_NAME} SHARED
${SRC}
)
target_link_libraries(${PROJECT_NAME}
pandora_client
pcap
yaml-cpp
${JPEG_LIB}
${Boost_LIBRARIES}
${PCL_COMMON_LIBRARIES}
${PCL_IO_LIBRARIES}
${LINK_LIBRARY_PLUS}
)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(pandora_sdk_test
src/test.cc
)
target_link_libraries(pandora_sdk_test
${PROJECT_NAME}
${Boost_LIBRARIES}
${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES}
${LINK_LIBRARY_PLUS}
)
endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
if (ENABLE_SAMPLE)
add_subdirectory(sample/pandar40)
add_subdirectory(sample/pandar40p)
add_subdirectory(sample/pandora)
endif()
#set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/SDK)
install(PROGRAMS include/hesaiLidarSDK.h DESTINATION include)
install(PROGRAMS include/point_types.h DESTINATION include)
install(DIRECTORY sample DESTINATION .)
install(PROGRAMS ${CMAKE_BINARY_DIR}/lib/lib${PROJECT_NAME}.so DESTINATION lib)