Skip to content

Commit

Permalink
Fix/futurize foxy dependency fixes (#780)
Browse files Browse the repository at this point in the history
* Kludge: add transitive dependencies for rosbag2_cpp
* Kludge: add transitive dependencies for rosbag2_compression_zstd
* Kludge: add transitive dependencies for rosbag2_compression
* Kludge: add transitive dependencies for rosbag2_transport
* Kludge: add transitive dependencies for rosbag2_tests

Signed-off-by: Aleksandr Rozhdestvenskii <[email protected]>
Signed-off-by: Emerson Knapp <[email protected]>
  • Loading branch information
hexonxons authored and Emerson Knapp committed Jun 16, 2021
1 parent e4f67c2 commit bce8769
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 20 deletions.
8 changes: 8 additions & 0 deletions rosbag2_compression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ if(BUILD_TESTING)
test/rosbag2_compression/fake_compressor.cpp
test/rosbag2_compression/fake_decompressor.cpp)
target_link_libraries(fake_plugin ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(fake_plugin rosbag2_cpp rosbag2_storage)
install(
TARGETS fake_plugin
ARCHIVE DESTINATION lib
Expand All @@ -86,22 +88,28 @@ if(BUILD_TESTING)
ament_add_gmock(test_compression_factory
test/rosbag2_compression/test_compression_factory.cpp)
target_link_libraries(test_compression_factory ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_compression_factory rosbag2_cpp rosbag2_storage)

ament_add_gmock(test_compression_options
test/rosbag2_compression/test_compression_options.cpp)
target_include_directories(test_compression_options PUBLIC include)
target_link_libraries(test_compression_options ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_compression_options rosbag2_cpp rosbag2_storage)

ament_add_gmock(test_sequential_compression_reader
test/rosbag2_compression/test_sequential_compression_reader.cpp)
target_include_directories(test_sequential_compression_reader PUBLIC include)
target_link_libraries(test_sequential_compression_reader ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_sequential_compression_reader rosbag2_cpp rosbag2_storage)

ament_add_gmock(test_sequential_compression_writer
test/rosbag2_compression/test_sequential_compression_writer.cpp)
target_include_directories(test_sequential_compression_writer PUBLIC include)
target_link_libraries(test_sequential_compression_writer ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_sequential_compression_writer rosbag2_cpp rosbag2_storage)
endif()

Expand Down
11 changes: 8 additions & 3 deletions rosbag2_compression_zstd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ target_include_directories(${PROJECT_NAME}
ament_target_dependencies(${PROJECT_NAME}
rcpputils
rosbag2_compression
zstd)
zstd
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
rosbag2_cpp
rosbag2_storage)
target_compile_definitions(${PROJECT_NAME} PRIVATE ROSBAG2_COMPRESSION_ZSTD_BUILDING_DLL)
pluginlib_export_plugin_description_file(rosbag2_compression plugin_description.xml)

Expand Down Expand Up @@ -69,9 +72,11 @@ if(BUILD_TESTING)

ament_add_gmock(test_zstd_compressor
test/rosbag2_compression_zstd/test_zstd_compressor.cpp)
target_include_directories(test_zstd_compressor PUBLIC include)
target_link_libraries(test_zstd_compressor ${PROJECT_NAME})
ament_target_dependencies(test_zstd_compressor rclcpp rosbag2_test_common)

ament_target_dependencies(test_zstd_compressor rclcpp rosbag2_test_common
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
rosbag2_cpp rosbag2_storage zstd rosbag2_compression)
endif()

ament_package()
23 changes: 17 additions & 6 deletions rosbag2_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,43 +140,52 @@ if(BUILD_TESTING)
ament_add_gmock(test_converter_factory
test/rosbag2_cpp/test_converter_factory.cpp)
if(TARGET test_converter_factory)
target_include_directories(test_converter_factory PRIVATE include)
target_link_libraries(test_converter_factory ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_converter_factory rosbag2_storage)
endif()

ament_add_gmock(test_typesupport_helpers
test/rosbag2_cpp/test_typesupport_helpers.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_typesupport_helpers)
target_link_libraries(test_typesupport_helpers ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_typesupport_helpers rosbag2_storage rosbag2_test_common)
endif()

ament_add_gmock(test_info
test/rosbag2_cpp/test_info.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_info)
target_link_libraries(test_info ${PROJECT_NAME})
ament_target_dependencies(test_info rosbag2_test_common)
ament_target_dependencies(test_info rosbag2_test_common
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
rosbag2_storage)
endif()

ament_add_gmock(test_sequential_reader
test/rosbag2_cpp/test_sequential_reader.cpp)
if(TARGET test_sequential_reader)
ament_target_dependencies(test_sequential_reader rosbag2_storage)
target_link_libraries(test_sequential_reader ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_sequential_reader rosbag2_storage)
endif()

ament_add_gmock(test_storage_without_metadata_file
test/rosbag2_cpp/test_storage_without_metadata_file.cpp)
if(TARGET test_storage_without_metadata_file)
ament_target_dependencies(test_storage_without_metadata_file rosbag2_storage)
target_link_libraries(test_storage_without_metadata_file ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_storage_without_metadata_file rosbag2_storage)
endif()

ament_add_gmock(test_message_cache
test/rosbag2_cpp/test_message_cache.cpp)
if(TARGET test_message_cache)
target_link_libraries(test_message_cache ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_message_cache rosbag2_storage)
endif()

# If compiling with gcc, run this test with sanitizers enabled
Expand Down Expand Up @@ -207,15 +216,17 @@ if(BUILD_TESTING)
ament_add_gmock(test_sequential_writer
test/rosbag2_cpp/test_sequential_writer.cpp)
if(TARGET test_sequential_writer)
ament_target_dependencies(test_sequential_writer rosbag2_storage)
target_link_libraries(test_sequential_writer ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_sequential_writer rosbag2_storage)
endif()

ament_add_gmock(test_multifile_reader
test/rosbag2_cpp/test_multifile_reader.cpp)
if(TARGET test_multifile_reader)
ament_target_dependencies(test_multifile_reader rosbag2_storage)
target_link_libraries(test_multifile_reader ${PROJECT_NAME})
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_multifile_reader rosbag2_storage)
endif()
endif()

Expand Down
13 changes: 11 additions & 2 deletions rosbag2_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,31 @@ if(BUILD_TESTING)
find_package(rosbag2_test_common REQUIRED)
find_package(std_msgs REQUIRED)
find_package(test_msgs REQUIRED)
find_package(zstd_vendor REQUIRED)

ament_add_gmock(test_rosbag2_record_end_to_end
test/rosbag2_tests/test_rosbag2_record_end_to_end.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_rosbag2_record_end_to_end)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_rosbag2_record_end_to_end
rclcpp
rosbag2_cpp
rosbag2_compression
rosbag2_compression_zstd
rosbag2_storage
rosbag2_storage_default_plugins
rosbag2_test_common
test_msgs)
test_msgs
zstd_vendor)
ament_add_test_label(test_rosbag2_record_end_to_end xfail)
endif()

ament_add_gmock(test_rosbag2_play_end_to_end
test/rosbag2_tests/test_rosbag2_play_end_to_end.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_rosbag2_play_end_to_end)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_rosbag2_play_end_to_end
rclcpp
rosbag2_storage
Expand All @@ -73,6 +78,7 @@ if(BUILD_TESTING)
test/rosbag2_tests/test_rosbag2_info_end_to_end.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_rosbag2_info_end_to_end)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_rosbag2_info_end_to_end
rosbag2_storage
rosbag2_test_common)
Expand All @@ -83,16 +89,19 @@ if(BUILD_TESTING)
test/rosbag2_tests/test_converter.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_converter)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_converter
rosbag2_cpp
rosbag2_test_common
test_msgs)
test_msgs
rosbag2_storage)
endif()

ament_add_gmock(test_rosbag2_cpp_api
test/rosbag2_tests/test_rosbag2_cpp_api.cpp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
if(TARGET test_rosbag2_cpp_api)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
ament_target_dependencies(test_rosbag2_cpp_api
rclcpp
rosbag2_cpp
Expand Down
31 changes: 22 additions & 9 deletions rosbag2_transport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ ament_target_dependencies(rosbag2_transport_py
rosbag2_cpp
rosbag2_storage
rmw
shared_queues_vendor
)
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
Expand All @@ -94,17 +95,20 @@ function(create_tests_for_rmw_implementation)
rosbag2_transport_add_gmock(test_record_all
test/rosbag2_transport/test_record_all.cpp
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor)

rosbag2_transport_add_gmock(test_record_all_no_discovery
test/rosbag2_transport/test_record_all_no_discovery.cpp
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor)

rosbag2_transport_add_gmock(test_play_timing
test/rosbag2_transport/test_play_timing.cpp
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor)

rosbag2_transport_add_gmock(test_rosbag2_node
src/rosbag2_transport/generic_publisher.cpp
Expand All @@ -118,21 +122,25 @@ function(create_tests_for_rmw_implementation)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/rosbag2_transport>
$<INSTALL_INTERFACE:include>
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS
ament_index_cpp
rclcpp
rosbag2_cpp
rosbag2_storage
rosbag2_test_common
test_msgs
yaml_cpp_vendor)
yaml_cpp_vendor
rosbag2_compression
shared_queues_vendor)

rosbag2_transport_add_gmock(test_qos
src/rosbag2_transport/qos.cpp
test/rosbag2_transport/test_qos.cpp
INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/rosbag2_transport>
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS
rclcpp
rosbag2_test_common
Expand All @@ -147,36 +155,41 @@ function(create_tests_for_rmw_implementation)

rosbag2_transport_add_gmock(test_record
test/rosbag2_transport/test_record.cpp
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor
INCLUDE_DIRS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/rosbag2_transport>
LINK_LIBS rosbag2_transport
${SKIP_TEST})

rosbag2_transport_add_gmock(test_record_regex
test/rosbag2_transport/test_record_regex.cpp
LINK_LIBS rosbag2_transport
AMENT_DEPS test_msgs rosbag2_test_common
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor rosbag2_cpp rosbag2_storage
${SKIP_TEST})

rosbag2_transport_add_gmock(test_play
src/rosbag2_transport/qos.cpp
test/rosbag2_transport/test_play.cpp
INCLUDE_DIRS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/rosbag2_transport>
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor
${SKIP_TEST})

rosbag2_transport_add_gmock(test_play_loop
test/rosbag2_transport/test_play_loop.cpp
${SKIP_TEST}
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor)

rosbag2_transport_add_gmock(test_play_topic_remap
test/rosbag2_transport/test_play_topic_remap.cpp
${SKIP_TEST}
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common)
# Needs to be removed/revised after https://github.com/ros2/ros2/issues/1150 gets fixed
AMENT_DEPS rosbag2_cpp rosbag2_storage test_msgs rosbag2_test_common rosbag2_compression shared_queues_vendor)
endfunction()

if(BUILD_TESTING)
Expand Down

0 comments on commit bce8769

Please sign in to comment.