Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,45 @@ foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
ament_target_dependencies(${rosidl_generate_interfaces_TARGET}${_target_suffix}
${_pkg_name}
)
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix}
${${_pkg_name}_LIBRARIES${_target_suffix}}
set(_dep_tslibs "")
get_filename_component(_dep_prefix "${${_pkg_name}_DIR}/../../.." ABSOLUTE)
foreach(_dep_tslib ${${_pkg_name}_LIBRARIES${_target_suffix}})
if(IS_ABSOLUTE "${_dep_tslib}" AND EXISTS "${_dep_tslib}")
list(APPEND _dep_tslibs "${_dep_tslib}")
else()
unset(_dep_tslib_abs CACHE)
unset(_dep_tslib_abs)
find_library(_dep_tslib_abs
NAMES "${_dep_tslib}" "${_pkg_name}${_target_suffix}"
HINTS "${_dep_prefix}"
PATH_SUFFIXES lib lib64 "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
NO_DEFAULT_PATH
)
if(_dep_tslib_abs)
list(APPEND _dep_tslibs "${_dep_tslib_abs}")
else()
# Preserve previous behavior if resolution fails (e.g. plain link name or CMake target)
list(APPEND _dep_tslibs "${_dep_tslib}")
endif()
Comment thread
EugenioCollado marked this conversation as resolved.
endif()
endforeach()
if(NOT _dep_tslibs)
unset(_dep_tslib_abs CACHE)
unset(_dep_tslib_abs)
find_library(_dep_tslib_abs
NAMES "${_pkg_name}${_target_suffix}"
HINTS "${_dep_prefix}/lib" "${_dep_prefix}/lib64"
NO_DEFAULT_PATH
)
if(_dep_tslib_abs)
list(APPEND _dep_tslibs "${_dep_tslib_abs}")
endif()
endif()
if(_dep_tslibs)
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix}
${_dep_tslibs}
)
endif()
endforeach()

target_link_libraries(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ TEMPLATE(
include_directives=include_directives)
}@

@{
TEMPLATE(
'msg__rosidl_typesupport_microxrcedds_c.h.em',
package_name=package_name,
interface_path=interface_path,
message=service.event_message,
include_directives=include_directives)
}@

@{
header_files = [
'rosidl_runtime_c/service_type_support_struct.h',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ from rosidl_generator_c import idl_structure_type_to_c_typename
from rosidl_generator_type_description import GET_DESCRIPTION_FUNC
from rosidl_generator_type_description import GET_HASH_FUNC
from rosidl_generator_type_description import GET_SOURCES_FUNC
from rosidl_parser.definition import SERVICE_EVENT_MESSAGE_SUFFIX
from rosidl_parser.definition import SERVICE_REQUEST_MESSAGE_SUFFIX
from rosidl_parser.definition import SERVICE_RESPONSE_MESSAGE_SUFFIX

Expand All @@ -25,15 +24,6 @@ TEMPLATE(
include_directives=include_directives)
}@

@{
TEMPLATE(
'msg__type_support_c.c.em',
package_name=package_name,
interface_path=interface_path,
message=service.event_message,
include_directives=include_directives)
}@

@{
from rosidl_cmake import convert_camel_case_to_lower_case_underscore

Expand Down Expand Up @@ -78,16 +68,10 @@ static rosidl_service_type_support_t @(service.namespaced_type.name)__handle = {

&_@(service.namespaced_type.name)@(SERVICE_REQUEST_MESSAGE_SUFFIX)__type_support,
&_@(service.namespaced_type.name)@(SERVICE_RESPONSE_MESSAGE_SUFFIX)__type_support,
&_@(service.namespaced_type.name)@(SERVICE_EVENT_MESSAGE_SUFFIX)__type_support,
NULL,

ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_CREATE_EVENT_MESSAGE_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(service.namespaced_type.namespaced_name()))
),
ROSIDL_TYPESUPPORT_INTERFACE__SERVICE_DESTROY_EVENT_MESSAGE_SYMBOL_NAME(
rosidl_typesupport_c,
@(',\n '.join(service.namespaced_type.namespaced_name()))
),
NULL,
NULL,

&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_HASH_FUNC),
&@(idl_structure_type_to_c_typename(service.namespaced_type))__@(GET_DESCRIPTION_FUNC),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,45 @@ foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
ament_target_dependencies(${rosidl_generate_interfaces_TARGET}${_target_suffix}
${_pkg_name}
)
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix}
${${_pkg_name}_LIBRARIES${_target_suffix}}
set(_dep_tslibs "")
get_filename_component(_dep_prefix "${${_pkg_name}_DIR}/../../.." ABSOLUTE)
foreach(_dep_tslib ${${_pkg_name}_LIBRARIES${_target_suffix}})
if(IS_ABSOLUTE "${_dep_tslib}" AND EXISTS "${_dep_tslib}")
list(APPEND _dep_tslibs "${_dep_tslib}")
else()
unset(_dep_tslib_abs CACHE)
unset(_dep_tslib_abs)
find_library(_dep_tslib_abs
NAMES "${_dep_tslib}" "${_pkg_name}${_target_suffix}"
HINTS "${_dep_prefix}"
PATH_SUFFIXES lib lib64 "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
NO_DEFAULT_PATH
)
if(_dep_tslib_abs)
list(APPEND _dep_tslibs "${_dep_tslib_abs}")
else()
# Preserve previous behavior if resolution fails (e.g. plain link name or CMake target)
list(APPEND _dep_tslibs "${_dep_tslib}")
endif()
Comment thread
EugenioCollado marked this conversation as resolved.
endif()
endforeach()
if(NOT _dep_tslibs)
unset(_dep_tslib_abs CACHE)
unset(_dep_tslib_abs)
find_library(_dep_tslib_abs
NAMES "${_pkg_name}${_target_suffix}"
HINTS "${_dep_prefix}/lib" "${_dep_prefix}/lib64"
NO_DEFAULT_PATH
)
if(_dep_tslib_abs)
list(APPEND _dep_tslibs "${_dep_tslib_abs}")
endif()
endif()
if(_dep_tslibs)
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix}
${_dep_tslibs}
)
endif()
endforeach()

target_link_libraries(
Expand Down