diff --git a/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake b/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake
index c1b3f8d6..1f6fdc3c 100644
--- a/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake
+++ b/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-find_package(rmw_implementation_cmake REQUIRED)
find_package(rmw REQUIRED)
find_package(rosidl_runtime_c REQUIRED)
find_package(rosidl_typesupport_c REQUIRED)
diff --git a/rosidl_generator_py/cmake/rosidl_generator_py_get_typesupports.cmake b/rosidl_generator_py/cmake/rosidl_generator_py_get_typesupports.cmake
index dcd0dd97..73655b12 100644
--- a/rosidl_generator_py/cmake/rosidl_generator_py_get_typesupports.cmake
+++ b/rosidl_generator_py/cmake/rosidl_generator_py_get_typesupports.cmake
@@ -12,19 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-macro(accumulate_typesupports)
- set(_typesupport_impl "")
- if(${rmw_implementation}_FOUND)
- get_rmw_typesupport(_typesupport_impl ${rmw_implementation} LANGUAGE "C")
- list_append_unique(_typesupport_impls ${_typesupport_impl})
- endif()
-endmacro()
-
macro(rosidl_generator_py_get_typesupports TYPESUPPORT_IMPLS)
- set(TYPESUPPORT_IMPLS "")
- set(_typesupport_impls "")
- call_for_each_rmw_implementation(accumulate_typesupports)
- foreach(_typesupport_impl ${_typesupport_impls})
- list_append_unique(TYPESUPPORT_IMPLS ${_typesupport_impl})
+ set(${TYPESUPPORT_IMPLS} "")
+ ament_index_get_resources(${TYPESUPPORT_IMPLS} "rosidl_typesupport_c")
+ list(APPEND ${TYPESUPPORT_IMPLS} "rosidl_typesupport_c")
+ foreach(_typesupport ${${TYPESUPPORT_IMPLS}})
+ find_package(${_typesupport} QUIET)
+ if(NOT ${_typesupport}_FOUND)
+ list(REMOVE_ITEM ${TYPESUPPORT_IMPLS} "${_typesupport}")
+ endif()
endforeach()
endmacro()
diff --git a/rosidl_generator_py/package.xml b/rosidl_generator_py/package.xml
index 51aa78ed..1970f72a 100644
--- a/rosidl_generator_py/package.xml
+++ b/rosidl_generator_py/package.xml
@@ -23,8 +23,7 @@
rosidl_typesupport_interface
python3-numpy
- rmw_implementation
- rmw_implementation_cmake
+ rosidl_generator_c
rosidl_parser
rosidl_runtime_c
@@ -36,8 +35,6 @@
python3-pytest
python_cmake_module
rmw
- rmw_implementation
- rmw_implementation_cmake
rosidl_cmake
rosidl_generator_c
rosidl_generator_cpp