From 4d1bfd12aa2ce317d3280e4b82d7ecc232b7df8e Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 24 Oct 2025 13:56:10 +0200 Subject: [PATCH] Depend on ros_environment for Humble detection PR #98 mistakenly removed ros_environment from package.xml. This broke Humble detection, which had to be worked around in 9b03f97 ("try detecting Humble in the build farm", 2025-06-10). This PR adds ros_environment dependency back and removes the Humble detection workaround. This also helps with building the package using the Nix package manager. --- package.xml | 1 + src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 9f9f7a29..14d9abd3 100644 --- a/package.xml +++ b/package.xml @@ -14,6 +14,7 @@ ament_cmake + ros_environment rclcpp rcpputils rosbag2_transport diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fb512d84..5ccde2d1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,7 +47,7 @@ target_link_libraries( TopicPublisherROS2 commonROS) message("AMENT_PREFIX_PATH = ${AMENT_PREFIX_PATH}") message("ROS_DISTRO (env) = $ENV{ROS_DISTRO}") -if("${AMENT_PREFIX_PATH}" STREQUAL "/opt/ros/humble" OR "$ENV{ROS_DISTRO}" STREQUAL "humble") +if("$ENV{ROS_DISTRO}" STREQUAL "humble") message(STATUS "Detected Humble") target_compile_definitions(DataLoadROS2 PUBLIC ROS_HUMBLE) target_compile_definitions(TopicPublisherROS2 PUBLIC ROS_HUMBLE)