From aa6dfb22d026ea96dad47c6463c04e76ffc0a775 Mon Sep 17 00:00:00 2001 From: stephendb Date: Mon, 11 Jan 2021 16:15:43 -0600 Subject: [PATCH 1/2] for using this project as a submodule, needed to create an interface library otherwise the includes will not propagate to a parent project, interface library is a fake library since this is a header only project, also change the params to public as these are very useful to end users when inspecting packets --- CMakeLists.txt | 5 +++++ src/rs_driver/driver/decoder/decoder_factory.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0247cac4..6dafad0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ if(WIN32) cmake_policy(SET CMP0074 NEW) endif(WIN32) project(rs_driver VERSION 1.3.0) +add_library(rs_driver INTERFACE) + #============================= # Compile Demos&Tools @@ -83,6 +85,7 @@ endif(WIN32) find_package(Boost COMPONENTS system date_time regex REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) +target_include_directories(${PROJECT_NAME} INTERFACE ${Boost_INCLUDE_DIRS}) list(APPEND EXTERNAL_LIBS ${Boost_LIBRARIES}) #======================== @@ -92,6 +95,7 @@ if(WIN32) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) find_package(PCAP REQUIRED) include_directories(${PCAP_INCLUDE_DIR}) + target_include_directories(${PROJECT_NAME} INTERFACE ${PCAP_INCLUDE_DIR}) list(APPEND EXTERNAL_LIBS ${PCAP_LIBRARY}) else() list(APPEND EXTERNAL_LIBS pcap) @@ -104,6 +108,7 @@ if(${ENABLE_TRANSFORM}) add_definitions("-DENABLE_TRANSFORM") find_package(Eigen3 REQUIRED) include_directories(${EIGEN3_INCLUDE_DIR}) + target_include_directories(${PROJECT_NAME} INTERFACE ${EIGEN3_INCLUDE_DIR}) message(=============================================================) message("-- Enable Transform Fcuntions") message(=============================================================) diff --git a/src/rs_driver/driver/decoder/decoder_factory.hpp b/src/rs_driver/driver/decoder/decoder_factory.hpp index 5a7d1214..9dca51fe 100644 --- a/src/rs_driver/driver/decoder/decoder_factory.hpp +++ b/src/rs_driver/driver/decoder/decoder_factory.hpp @@ -51,7 +51,7 @@ class DecoderFactory ~DecoderFactory() = default; static std::shared_ptr> createDecoder(const RSDriverParam& param); -private: +public: static const LidarConstantParameter getRS16ConstantParam(); static const LidarConstantParameter getRS32ConstantParam(); static const LidarConstantParameter getRSBPConstantParam(); From d7196d11bd423e50358111c376b295aa0d6f1de6 Mon Sep 17 00:00:00 2001 From: stephendb Date: Mon, 11 Jan 2021 16:24:09 -0600 Subject: [PATCH 2/2] remove a space --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dafad0d..79ac10df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,6 @@ endif(WIN32) project(rs_driver VERSION 1.3.0) add_library(rs_driver INTERFACE) - #============================= # Compile Demos&Tools #============================= @@ -170,4 +169,4 @@ if(UNIX AND ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif(NOT TARGET uninstall) -endif(UNIX AND ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file +endif(UNIX AND ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})