142 lines
4.9 KiB
Diff
142 lines
4.9 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 05f84c5..4fb6f31 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -1,7 +1,9 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(livox_sdk2)
|
|
|
|
+find_package(ament_cmake REQUIRED)
|
|
+
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
message(STATUS "main project dir: " ${PROJECT_SOURCE_DIR})
|
|
@@ -18,3 +20,9 @@ endif(UNIX)
|
|
|
|
add_subdirectory(sdk_core)
|
|
add_subdirectory(samples)
|
|
+
|
|
+# Export the installed headers/libraries so ament packages (e.g. livox_ros_driver2)
|
|
+# find the SDK from the colcon install space via CMAKE_PREFIX_PATH.
|
|
+ament_export_include_directories(include)
|
|
+ament_export_libraries(livox_lidar_sdk_shared)
|
|
+ament_package()
|
|
diff --git a/package.xml b/package.xml
|
|
new file mode 100644
|
|
index 0000000..ffdf3ce
|
|
--- /dev/null
|
|
+++ b/package.xml
|
|
@@ -0,0 +1,18 @@
|
|
+<?xml version="1.0"?>
|
|
+<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
|
+<package format="3">
|
|
+ <name>livox_sdk2</name>
|
|
+ <version>1.3.1</version>
|
|
+ <description>
|
|
+ Livox SDK2: official C++ library for Livox LiDAR sensors.
|
|
+ Provides the livox_sdk2 ament target consumed by livox_ros_driver2.
|
|
+ </description>
|
|
+ <maintainer email="sdk@livoxtech.com">Livox</maintainer>
|
|
+ <license>Apache-2.0</license>
|
|
+
|
|
+ <buildtool_depend>ament_cmake</buildtool_depend>
|
|
+
|
|
+ <export>
|
|
+ <build_type>ament_cmake</build_type>
|
|
+ </export>
|
|
+</package>
|
|
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
|
|
index 77c05c7..14e2572 100644
|
|
--- a/samples/CMakeLists.txt
|
|
+++ b/samples/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(livox_sdk2)
|
|
|
|
diff --git a/samples/debug_point_cloud/CMakeLists.txt b/samples/debug_point_cloud/CMakeLists.txt
|
|
index c94f254..a4ccce7 100644
|
|
--- a/samples/debug_point_cloud/CMakeLists.txt
|
|
+++ b/samples/debug_point_cloud/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(DEMO_NAME debug_point_cloud)
|
|
add_executable(${DEMO_NAME} main.cpp)
|
|
diff --git a/samples/lidar_cmd_observer/CMakeLists.txt b/samples/lidar_cmd_observer/CMakeLists.txt
|
|
index 503ff6f..347d17e 100644
|
|
--- a/samples/lidar_cmd_observer/CMakeLists.txt
|
|
+++ b/samples/lidar_cmd_observer/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(DEMO_NAME lidar_cmd_observer)
|
|
add_executable(${DEMO_NAME} main.cpp)
|
|
diff --git a/samples/livox_lidar_quick_start/CMakeLists.txt b/samples/livox_lidar_quick_start/CMakeLists.txt
|
|
index 3f17580..ebc39f9 100644
|
|
--- a/samples/livox_lidar_quick_start/CMakeLists.txt
|
|
+++ b/samples/livox_lidar_quick_start/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(DEMO_NAME livox_lidar_quick_start)
|
|
add_executable(${DEMO_NAME} main.cpp)
|
|
diff --git a/samples/livox_lidar_rmc_time_sync/CMakeLists.txt b/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
|
|
index c976087..fcdcaf8 100644
|
|
--- a/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
|
|
+++ b/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(DEMO_NAME livox_lidar_rmc_time_sync)
|
|
if (WIN32)
|
|
diff --git a/samples/logger/CMakeLists.txt b/samples/logger/CMakeLists.txt
|
|
index 72b625b..252bf4b 100644
|
|
--- a/samples/logger/CMakeLists.txt
|
|
+++ b/samples/logger/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(DEMO_NAME logger)
|
|
add_executable(${DEMO_NAME} main.cpp)
|
|
diff --git a/samples/multi_lidars_upgrade/CMakeLists.txt b/samples/multi_lidars_upgrade/CMakeLists.txt
|
|
index 74f08d6..4b8dfa9 100644
|
|
--- a/samples/multi_lidars_upgrade/CMakeLists.txt
|
|
+++ b/samples/multi_lidars_upgrade/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(DEMO_NAME multi_lidars_upgrade)
|
|
add_executable(${DEMO_NAME} main.cpp)
|
|
diff --git a/sdk_core/CMakeLists.txt b/sdk_core/CMakeLists.txt
|
|
index 15e960d..98173f8 100644
|
|
--- a/sdk_core/CMakeLists.txt
|
|
+++ b/sdk_core/CMakeLists.txt
|
|
@@ -1,4 +1,4 @@
|
|
-cmake_minimum_required(VERSION 3.0)
|
|
+cmake_minimum_required(VERSION 3.5)
|
|
|
|
set(SDK_LIBRARY_STATIC livox_lidar_sdk_static)
|
|
set(SDK_LIBRARY_SHARED livox_lidar_sdk_shared)
|
|
@@ -142,3 +142,11 @@ install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
|
|
PUBLIC_HEADER DESTINATION include
|
|
ARCHIVE DESTINATION lib
|
|
LIBRARY DESTINATION lib)
|
|
+
|
|
+# livox_ros_driver2's (unpatched, vendor) CMakeLists.txt looks for the shared library and
|
|
+# headers with a raw find_library()/find_path() call pinned to /usr/local, not via colcon's
|
|
+# per-package install prefix -- so also install there directly.
|
|
+install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
|
|
+ PUBLIC_HEADER DESTINATION /usr/local/include
|
|
+ ARCHIVE DESTINATION /usr/local/lib
|
|
+ LIBRARY DESTINATION /usr/local/lib)
|