Skip to content

Commit d2c7492

Browse files
authored
Depend on ros_environment for Humble detection (#107)
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.
1 parent 66e9101 commit d2c7492

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<!-- ROS2 dependencies -->
1515
<buildtool_depend>ament_cmake</buildtool_depend>
1616

17+
<depend>ros_environment</depend>
1718
<depend>rclcpp</depend>
1819
<depend>rcpputils</depend>
1920
<depend>rosbag2_transport</depend>

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ target_link_libraries( TopicPublisherROS2 commonROS)
4747
message("AMENT_PREFIX_PATH = ${AMENT_PREFIX_PATH}")
4848
message("ROS_DISTRO (env) = $ENV{ROS_DISTRO}")
4949

50-
if("${AMENT_PREFIX_PATH}" STREQUAL "/opt/ros/humble" OR "$ENV{ROS_DISTRO}" STREQUAL "humble")
50+
if("$ENV{ROS_DISTRO}" STREQUAL "humble")
5151
message(STATUS "Detected Humble")
5252
target_compile_definitions(DataLoadROS2 PUBLIC ROS_HUMBLE)
5353
target_compile_definitions(TopicPublisherROS2 PUBLIC ROS_HUMBLE)

0 commit comments

Comments
 (0)