Skip to content

Commit 7de9a1d

Browse files
ivanpaunojacobperron
authored andcommitted
Fix typesupports not being found issue
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent 1b07cbb commit 7de9a1d

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

rosidl_generator_java/cmake/rosidl_generator_java_generate_interfaces.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
find_package(ament_cmake_export_jars REQUIRED)
1616
find_package(ament_cmake_export_jni_libraries REQUIRED)
1717
find_package(rosidl_generator_c REQUIRED)
18+
find_package(rosidl_typesupport_c REQUIRED)
1819
find_package(rmw_implementation_cmake REQUIRED)
1920
find_package(rmw REQUIRED)
2021
find_package(rcljava_common REQUIRED)

rosidl_generator_java/cmake/rosidl_generator_java_get_typesupports.cmake

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
macro(accumulate_typesupports)
16-
set(_typesupport_impl_tmp "")
17-
get_rmw_typesupport(_typesupport_impl_tmp ${rmw_implementation} LANGUAGE "C")
18-
list(APPEND _typesupport_impls_tmp ${_typesupport_impl_tmp})
19-
endmacro()
20-
2115
macro(rosidl_generator_java_get_typesupports TYPESUPPORT_IMPLS)
2216
set(${TYPESUPPORT_IMPLS} "")
23-
set(_typesupport_impls_tmp "")
24-
set(_typesupport_impls_tmp_unique "")
25-
call_for_each_rmw_implementation(accumulate_typesupports)
26-
27-
foreach(_typesupport_impl ${_typesupport_impls_tmp})
28-
list_append_unique(${TYPESUPPORT_IMPLS} ${_typesupport_impl})
17+
ament_index_get_resources(${TYPESUPPORT_IMPLS} "rosidl_typesupport_c")
18+
list(APPEND ${TYPESUPPORT_IMPLS} "rosidl_typesupport_c")
19+
foreach(_typesupport ${${TYPESUPPORT_IMPLS}})
20+
find_package(${_typesupport} QUIET)
21+
if(NOT ${_typesupport}_FOUND)
22+
list(REMOVE_ITEM ${TYPESUPPORT_IMPLS} "${_typesupport}")
23+
endif()
2924
endforeach()
3025
endmacro()

0 commit comments

Comments
 (0)