-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Transport rework port in progress for review #84
Changes from 17 commits
defbba4
fe68da5
01cfc33
e7dd7fe
09c9ffd
b08ed32
c95076e
23f3617
d9307c8
f263035
a86a847
5560254
17723b3
08c7945
a5a8c53
1406eef
dd2eb98
cc687fb
de98e0f
49ef0d9
6aece52
0b90ac1
3407982
e6d4361
4c838f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,121 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(image_transport) | ||
|
||
find_package(catkin REQUIRED | ||
COMPONENTS | ||
message_filters | ||
pluginlib | ||
rosconsole | ||
roscpp | ||
roslib | ||
sensor_msgs | ||
) | ||
# Default to C++14 | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 14) | ||
endif() | ||
|
||
find_package(Boost REQUIRED) | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
catkin_package( | ||
INCLUDE_DIRS include | ||
LIBRARIES ${PROJECT_NAME} | ||
DEPENDS message_filters pluginlib rosconsole roscpp roslib sensor_msgs | ||
) | ||
find_package(ament_cmake REQUIRED) | ||
|
||
find_package(message_filters REQUIRED) | ||
find_package(pluginlib REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(sensor_msgs REQUIRED) | ||
find_package(tinyxml_vendor REQUIRED) | ||
find_package(TinyXML REQUIRED) | ||
|
||
include_directories(include ${catkin_INCLUDE_DIRS}) | ||
include_directories(include) | ||
|
||
# Build libimage_transport | ||
# Build image_transport library | ||
add_library(${PROJECT_NAME} | ||
SHARED | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is a use case for this to be built statically (maybe there is not), we recommend using |
||
src/camera_common.cpp | ||
src/publisher.cpp | ||
src/subscriber.cpp | ||
src/single_subscriber_publisher.cpp | ||
src/camera_publisher.cpp | ||
src/camera_subscriber.cpp | ||
src/image_transport.cpp | ||
src/publisher.cpp | ||
src/single_subscriber_publisher.cpp | ||
src/subscriber.cpp | ||
) | ||
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) | ||
target_link_libraries(${PROJECT_NAME} | ||
${Boost_LIBRARIES} | ||
${catkin_LIBRARIES} | ||
|
||
ament_target_dependencies(${PROJECT_NAME} | ||
"message_filters" | ||
"pluginlib" | ||
"rclcpp" | ||
"sensor_msgs" | ||
"TinyXML" | ||
) | ||
|
||
# Build libimage_transport_plugins | ||
add_library(${PROJECT_NAME}_plugins src/manifest.cpp src/raw_publisher.cpp) | ||
# Build image_transport_plugins library (raw) | ||
add_library(${PROJECT_NAME}_plugins | ||
SHARED | ||
src/manifest.cpp | ||
) | ||
target_link_libraries(${PROJECT_NAME}_plugins ${PROJECT_NAME}) | ||
|
||
install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_plugins | ||
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
COMPONENT main | ||
) | ||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
) | ||
# Build list_trasnports | ||
add_executable(list_transports src/list_transports.cpp) | ||
target_link_libraries(list_transports ${PROJECT_NAME}) | ||
|
||
# add two execs | ||
# Build republish | ||
add_executable(republish src/republish.cpp) | ||
target_link_libraries(republish ${PROJECT_NAME}) | ||
|
||
add_executable(list_transports src/list_transports.cpp) | ||
target_link_libraries(list_transports | ||
${PROJECT_NAME} | ||
${catkin_LIBRARIES} | ||
# Install plugin descriptions | ||
pluginlib_export_plugin_description_file(image_transport default_plugins.xml) | ||
|
||
# Install libraries | ||
install( | ||
TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_plugins | ||
LIBRARY DESTINATION lib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For multi OS support in the future |
||
) | ||
|
||
install(TARGETS list_transports republish | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
# Install executables | ||
install( | ||
TARGETS list_transports republish | ||
RUNTIME DESTINATION share/${PROJECT_NAME} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Executables should be installed to |
||
) | ||
|
||
# add xml file | ||
install(FILES default_plugins.xml | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
# Install include directories | ||
install( | ||
DIRECTORY "include/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: quotes unnecessary here |
||
DESTINATION include | ||
) | ||
|
||
ament_export_include_directories(include) | ||
ament_export_libraries(${PROJECT_NAME}) | ||
ament_export_dependencies(message_filters) | ||
ament_export_dependencies(rclcpp) | ||
ament_export_dependencies(sensor_msgs) | ||
ament_export_dependencies(pluginlib) | ||
|
||
if(BUILD_TESTING) | ||
#TODO(ros2) enable linting | ||
#find_package(ament_lint_auto REQUIRED) | ||
#ament_lint_auto_find_test_dependencies() | ||
|
||
find_package(ament_cmake_gtest) | ||
|
||
ament_add_gtest(${PROJECT_NAME}-camera_common test/test_camera_common.cpp) | ||
if(TARGET ${PROJECT_NAME}-camera_common) | ||
target_link_libraries(${PROJECT_NAME}-camera_common ${PROJECT_NAME}) | ||
endif() | ||
|
||
ament_add_gtest(${PROJECT_NAME}-publisher test/test_publisher.cpp) | ||
if(TARGET ${PROJECT_NAME}-publisher) | ||
target_link_libraries(${PROJECT_NAME}-publisher ${PROJECT_NAME}) | ||
endif() | ||
|
||
ament_add_gtest(${PROJECT_NAME}-subscriber test/test_subscriber.cpp) | ||
if(TARGET ${PROJECT_NAME}-subscriber) | ||
target_link_libraries(${PROJECT_NAME}-subscriber ${PROJECT_NAME}) | ||
endif() | ||
|
||
ament_add_gtest(${PROJECT_NAME}-message_passing test/test_message_passing.cpp) | ||
if(TARGET ${PROJECT_NAME}-message_passing) | ||
target_link_libraries(${PROJECT_NAME}-message_passing ${PROJECT_NAME}) | ||
endif() | ||
|
||
ament_add_gtest(${PROJECT_NAME}-single_subscriber_publisher test/test_single_subscriber_publisher.cpp) | ||
if(TARGET ${PROJECT_NAME}-single_subscriber_publisher) | ||
target_link_libraries(${PROJECT_NAME}-single_subscriber_publisher ${PROJECT_NAME}) | ||
endif() | ||
endif() | ||
|
||
ament_package() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
tinyxml_vendor
/tinyxml
used anywhere in this package?