Skip to content

Commit

Permalink
Fix library naming issue and test linking errors
Browse files Browse the repository at this point in the history
  • Loading branch information
naiveHobo committed May 7, 2020
1 parent 3f7cb54 commit a40d8c9
Showing 1 changed file with 19 additions and 51 deletions.
70 changes: 19 additions & 51 deletions nav2_rviz_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,83 +85,49 @@ set(dependencies
tf2_geometry_msgs
)

set(nav2_rviz_plugins_goal_headers_to_moc
set(nav2_rviz_plugins_headers_to_moc
include/nav2_rviz_plugins/ros_action_qevent.hpp
include/nav2_rviz_plugins/goal_pose_updater
include/nav2_rviz_plugins/goal_common
include/nav2_rviz_plugins/goal_tool.hpp
include/nav2_rviz_plugins/nav2_panel.hpp
include/nav2_rviz_plugins/particle_cloud_display/flat_weighted_arrows_array.hpp
include/nav2_rviz_plugins/particle_cloud_display/particle_cloud_display.hpp
)

add_library(nav2_rviz_plugins_goal SHARED
add_library(nav2_rviz_plugins SHARED
src/goal_tool.cpp
src/nav2_panel.cpp
${nav2_rviz_plugins_goal_headers_to_moc}
src/particle_cloud_display/flat_weighted_arrows_array.cpp
src/particle_cloud_display/particle_cloud_display.cpp
${nav2_rviz_plugins_headers_to_moc}
)

ament_target_dependencies(nav2_rviz_plugins_goal
ament_target_dependencies(nav2_rviz_plugins
${dependencies}
)

target_include_directories(nav2_rviz_plugins_goal PUBLIC
target_include_directories(nav2_rviz_plugins PUBLIC
${Qt5Widgets_INCLUDE_DIRS}
${OGRE_INCLUDE_DIRS}
)

target_link_libraries(nav2_rviz_plugins_goal
target_link_libraries(nav2_rviz_plugins
rviz_common::rviz_common
)


set(nav2_rviz_plugins_particle_cloud_display_headers_to_moc
include/nav2_rviz_plugins/particle_cloud_display/flat_weighted_arrows_array.hpp
include/nav2_rviz_plugins/particle_cloud_display/particle_cloud_display.hpp
)

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
# TODO: Make this specific to this project (not rviz default plugins)
target_compile_definitions(nav2_rviz_plugins_goal PRIVATE "RVIZ_DEFAULT_PLUGINS_BUILDING_LIBRARY")
target_compile_definitions(nav2_rviz_plugins PRIVATE "RVIZ_DEFAULT_PLUGINS_BUILDING_LIBRARY")
# prevent pluginlib from using boost
target_compile_definitions(nav2_rviz_plugins_goal PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")


add_library(nav2_rviz_plugins_particle_cloud_display SHARED
src/particle_cloud_display/flat_weighted_arrows_array.cpp
src/particle_cloud_display/particle_cloud_display.cpp
${nav2_rviz_plugins_particle_cloud_display_headers_to_moc}
)

ament_target_dependencies(nav2_rviz_plugins_particle_cloud_display
${dependencies}
)

target_include_directories(nav2_rviz_plugins_particle_cloud_display PUBLIC
${Qt5Widgets_INCLUDE_DIRS}
${OGRE_INCLUDE_DIRS}
)

target_link_libraries(nav2_rviz_plugins_particle_cloud_display
rviz_common::rviz_common
)

target_compile_definitions(nav2_rviz_plugins_particle_cloud_display PRIVATE "RVIZ_DEFAULT_PLUGINS_BUILDING_LIBRARY")
target_compile_definitions(nav2_rviz_plugins_particle_cloud_display PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
target_compile_definitions(nav2_rviz_plugins PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")

pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)

install(
TARGETS nav2_rviz_plugins_goal
EXPORT nav2_rviz_plugins_goal
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

install(
TARGETS nav2_rviz_plugins_particle_cloud_display
EXPORT nav2_rviz_plugins_particle_cloud_display
TARGETS nav2_rviz_plugins
EXPORT nav2_rviz_plugins
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
Expand All @@ -184,6 +150,7 @@ if(BUILD_TESTING)
find_package(ament_index_cpp REQUIRED)
find_package(rviz_visual_testing_framework REQUIRED)
find_package(rviz_common REQUIRED)
find_package(rviz_default_plugins REQUIRED)
find_package(nav2_msgs REQUIRED)

set(TEST_INCLUDE_DIRS
Expand All @@ -193,12 +160,14 @@ if(BUILD_TESTING)
ament_include_directories_order(TEST_INCLUDE_DIRS ${TEST_INCLUDE_DIRS})

set(TEST_LINK_LIBRARIES
nav2_rviz_plugins_particle_cloud_display
nav2_rviz_plugins
rviz_common::rviz_common
)

set(TEST_TARGET_DEPENDENCIES
nav2_msgs
rviz_common
rviz_default_plugins
rclcpp
)

Expand Down Expand Up @@ -232,8 +201,7 @@ if(BUILD_TESTING)
endif()

ament_export_include_directories(include)
ament_export_interfaces(nav2_rviz_plugins_goal HAS_LIBRARY_TARGET)
ament_export_interfaces(nav2_rviz_plugins_particle_cloud_display HAS_LIBRARY_TARGET)
ament_export_interfaces(nav2_rviz_plugins HAS_LIBRARY_TARGET)
ament_export_dependencies(
Qt5
rviz_common
Expand Down

0 comments on commit a40d8c9

Please sign in to comment.