Skip to content

Commit

Permalink
perseus_sensors(m2m2_lidar): Added nlohmann and openSSL libraries
Browse files Browse the repository at this point in the history
Add two required libraries the package nix overlay and adjusted the CMakeLists file.
Due to needing both openssl::crypto and openssl::ssl had to add an explicit target_link_libraries to CMakeLists.txt
  • Loading branch information
DingoOz committed Dec 22, 2024
1 parent cb44609 commit c7e6831
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion software/ros_ws/nix-packages/perseus-sensors.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
backward-ros,
rclcpp,
sensor-msgs,
nlohmann_json,
openssl,
}:
buildRosPackage rec {
pname = "ros-jazzy-perseus-sensors";
Expand All @@ -14,7 +16,11 @@ buildRosPackage rec {
src = ./../src/perseus_sensors;

buildType = "ament_cmake";
buildInputs = [ ament-cmake ];
buildInputs = [
ament-cmake
nlohmann_json
openssl
];
propagatedBuildInputs = [
backward-ros
rclcpp
Expand Down
9 changes: 8 additions & 1 deletion software/ros_ws/src/perseus_sensors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# INCLUDE DEPENDENCIES

# public dependencies (which should propagate)
set(THIS_PACKAGE_INCLUDE_DEPENDS rclcpp sensor_msgs std_msgs OpenSSL)
set(THIS_PACKAGE_INCLUDE_DEPENDS rclcpp sensor_msgs std_msgs OpenSSL
nlohmann_json)
# packages which must be present but aren't linked against
set(THIS_PACKAGE_BUILD_DEPENDS backward_ros ament_cmake)

Expand All @@ -66,6 +67,12 @@ target_include_directories(

ament_target_dependencies(m2m2_lidar PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS})

# OpenSSL has two libraries that need to linked against explicitly
target_link_libraries(
m2m2_lidar
PRIVATE OpenSSL::SSL OpenSSL::Crypto nlohmann_json::nlohmann_json
${rclcpp_LIBRARIES} ${sensor_msgs_LIBRARIES} ${std_msgs_LIBRARIES})

# INSTALL (ROS Executables)
install(TARGETS m2m2_lidar DESTINATION lib/${PROJECT_NAME})

Expand Down

0 comments on commit c7e6831

Please sign in to comment.