-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
52 lines (43 loc) · 1.53 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
cmake_minimum_required(VERSION 3.5)
project(inc_ndt_lins)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/livox_ros_driver2)
include_directories(
${CMAKE_BINARY_DIR}/thirdparty/livox_ros_driver2/rosidl_generator_cpp)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include /usr/inlcude/eigen3)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(PCL REQUIRED)
find_package(Sophus REQUIRED)
find_package(G2O REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rosbag2_cpp REQUIRED)
find_package(TBB REQUIRED)
file(GLOB SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
add_library(inc_ndt_lins ${SRC_FILES})
target_link_libraries(
inc_ndt_lins
${PCL_LIBRARIES}
Sophus::Sophus
g2o_core
g2o_stuff
livox_ros_driver2
TBB::tbb)
set_target_properties(
inc_ndt_lins PROPERTIES RUNTIME_LIBRARY_DIRS
${PROJECT_SOURCE_DIR}/lib/${CMAKE_BUILD_TYPE})
ament_target_dependencies(inc_ndt_lins rclcpp sensor_msgs rosbag2_cpp)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/example)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()