File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1+ # Set ROS_DISTRO. This is needed for finding zenoh packages vendored by ROS 2
2+ export ROS_DISTRO=" jazzy"
Original file line number Diff line number Diff line change 11cppzmq-dev
2+ ros-jazzy-zenoh-cpp-vendor
Original file line number Diff line number Diff line change @@ -108,12 +108,27 @@ gz_find_package(CPPZMQ REQUIRED PRIVATE
108108
109109########################################
110110# Find Zenoh
111- find_package (zenohc )
112- find_package (zenohcxx )
113- if (NOT zenohcxx_DIR)
111+
112+ find_package (zenohc QUIET )
113+ find_package (zenohcxx QUIET )
114+
115+ # If both zenohc and zenohcpp packages are not found then
116+ # look for these pacakages installed by ROS 2 zenoh_cpp_vendor package
117+ if (NOT zenohc_FOUND AND NOT zenohcxx_FOUND)
118+ # Set CMAKE_PREFIX_PATH in order to find ROS 2 packages from plain cmake
119+ # package, see https://github.com/ament/ament_cmake/issues/304
120+ set (ros2_zenoh_cmake_path "/opt/ros/$ENV{ROS_DISTRO} /opt/zenoh_cpp_vendor/lib/cmake" )
121+ if (EXISTS ${ros2_zenoh_cmake_path} )
122+ list (PREPEND CMAKE_PREFIX_PATH ${ros2_zenoh_cmake_path} )
123+ find_package (zenohc QUIET )
124+ find_package (zenohcxx QUIET )
125+ endif ()
126+ endif ()
127+
128+ if (NOT zenohcxx_FOUND)
114129 message (STATUS "Looking for zenohcxx - not found" )
115130 set (HAVE_ZENOH OFF CACHE BOOL "HAVE ZENOH" FORCE )
116- elseif (NOT zenohc_DIR )
131+ elseif (NOT zenohc_FOUND )
117132 message (STATUS "Looking for zenohc - not found" )
118133 set (HAVE_ZENOH OFF CACHE BOOL "HAVE ZENOH" FORCE )
119134else ()
You can’t perform that action at this time.
0 commit comments