Skip to content

Commit

Permalink
change export order for static linking
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Mar 9, 2018
1 parent cba42d5 commit 0378271
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions rmw_fastrtps_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ find_package(rosidl_generator_c REQUIRED)
find_package(rosidl_typesupport_introspection_c REQUIRED)
find_package(rosidl_typesupport_introspection_cpp REQUIRED)

ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)
ament_export_dependencies(rosidl_generator_c)
ament_export_dependencies(rosidl_typesupport_introspection_c)
ament_export_dependencies(rosidl_typesupport_introspection_cpp)

include_directories(include)

add_library(rmw_fastrtps_cpp
Expand Down Expand Up @@ -87,6 +81,7 @@ add_library(rmw_fastrtps_cpp
target_link_libraries(rmw_fastrtps_cpp
fastcdr fastrtps)

# specific order: dependents before dependencies
ament_target_dependencies(rmw_fastrtps_cpp
"rcutils"
"rosidl_typesupport_introspection_c"
Expand All @@ -102,9 +97,16 @@ configure_rmw_library(rmw_fastrtps_cpp)
target_compile_definitions(${PROJECT_NAME}
PRIVATE "RMW_FASTRTPS_CPP_BUILDING_LIBRARY")

# specific order: dependents before dependencies
ament_export_include_directories(include)
ament_export_libraries(rmw_fastrtps_cpp)

ament_export_dependencies(rosidl_typesupport_introspection_cpp)
ament_export_dependencies(rosidl_typesupport_introspection_c)
ament_export_dependencies(rosidl_generator_c)
ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)

register_rmw_implementation(
"c:rosidl_typesupport_c:rosidl_typesupport_introspection_c"
"cpp:rosidl_typesupport_cpp:rosidl_typesupport_introspection_cpp")
Expand All @@ -115,7 +117,7 @@ if(BUILD_TESTING)
endif()

ament_package(
CONFIG_EXTRAS "rmw_fastrtps_cpp-extras.cmake"
CONFIG_EXTRAS_POST "rmw_fastrtps_cpp-extras.cmake"
)

install(
Expand Down
3 changes: 2 additions & 1 deletion rmw_fastrtps_cpp/rmw_fastrtps_cpp-extras.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ find_package(fastrtps REQUIRED CONFIG)
find_package(FastRTPS REQUIRED MODULE)

list(APPEND rmw_fastrtps_cpp_INCLUDE_DIRS ${FastRTPS_INCLUDE_DIR})
list(APPEND rmw_fastrtps_cpp_LIBRARIES fastcdr fastrtps)
# specific order: dependents before dependencies
list(APPEND rmw_fastrtps_cpp_LIBRARIES fastrtps fastcdr)

0 comments on commit 0378271

Please sign in to comment.