-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
44 lines (37 loc) · 1.65 KB
/
CMakeLists.txt
File metadata and controls
44 lines (37 loc) · 1.65 KB
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
cmake_minimum_required(VERSION 3.10)
project(sending_camera_lidar)
# Set the build type to Debug
set(CMAKE_BUILD_TYPE Debug)
# Check if cross-compiling
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
message(STATUS "Cross-compiling for Raspberry Pi 4")
else()
message(STATUS "Building for x86_64 PC")
endif()
# Ensure C++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find dependencies
find_package(OpenCV REQUIRED)
find_package(PCL REQUIRED)
# Include directories
include_directories(${OpenCV_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS} )
link_directories(${RPLIDAR_SDK_LIB_DIR}) # Add the RPLIDAR SDK library directory to the linker search path
add_definitions(${PCL_DEFINITIONS})
# Add executable
add_executable(sending_camera_lidar src/main.cpp src/StereoCamera.cpp src/LidarScanner.cpp)
# Link libraries
target_link_libraries(sending_camera_lidar
${OpenCV_LIBS} # Link the opencv SDK static library
${PCL_LIBRARIES} # Link the pcl SDK static library
pthread
${RPLIDAR_SDK_LIB_DIR}/libsl_lidar_sdk.so # Link the RPLIDAR SDK dynamic library
)
# Include directories
include_directories(${CMAKE_SOURCE_DIR}/include # Include MY headers
${OpenCV_INCLUDE_DIRS} # Include opencv headers
${PCL_INCLUDE_DIRS} # Include PCL headers
${RPLIDAR_SDK_DIR}/sdk/include # Include RPLIDAR SDK headers
${RPLIDAR_SDK_DIR}/sdk/src # Include RPLIDAR SDK headers
)