From a64bfe12f8d6b31c3c495cbd05abcded17f85e71 Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Tue, 21 May 2019 15:53:02 +0200 Subject: [PATCH 1/2] Allow linking other catkin programs to the LMS1xx library. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8dedc7..572ee9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ target_link_libraries(LMS1xx ${console_bridge_LIBRARIES}) # Regular catkin package follows. find_package(catkin REQUIRED COMPONENTS roscpp sensor_msgs) -catkin_package(CATKIN_DEPENDS roscpp) +catkin_package(CATKIN_DEPENDS roscpp sensor_msgs INCLUDE_DIRS include LIBRARIES LMS1xx) include_directories(include ${catkin_INCLUDE_DIRS}) add_executable(LMS1xx_node src/LMS1xx_node.cpp) From a5a9da95560ca8224b9f983ba461cff55582b3f9 Mon Sep 17 00:00:00 2001 From: Tomas Petricek Date: Mon, 27 May 2019 17:23:37 +0200 Subject: [PATCH 2/2] Make sure that the library is compiled with position independent code. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 572ee9b..566a7ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(lms1xx) find_package(console_bridge REQUIRED) include_directories(include ${console_bridge_INCLUDE_DIRS}) add_library(LMS1xx src/LMS1xx.cpp) +set_property(TARGET LMS1xx PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(LMS1xx ${console_bridge_LIBRARIES}) # Regular catkin package follows.