From 5f1fc660eaaa17017e4df0f76045e6777c6ba82e Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 22 Mar 2018 16:26:42 -0700 Subject: [PATCH] change export order for static linking (#446) --- rclcpp/CMakeLists.txt | 23 ++++++++++++----------- rclcpp_lifecycle/CMakeLists.txt | 10 ++++++---- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/rclcpp/CMakeLists.txt b/rclcpp/CMakeLists.txt index 51389fc..0828e2d 100644 --- a/rclcpp/CMakeLists.txt +++ b/rclcpp/CMakeLists.txt @@ -95,11 +95,12 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS}) +# specific order: dependents before dependencies ament_target_dependencies(${PROJECT_NAME} - "builtin_interfaces" "rcl" - "rosidl_generator_cpp" - "rosidl_typesupport_cpp") + "builtin_interfaces" + "rosidl_typesupport_cpp" + "rosidl_generator_cpp") # Causes the visibility macros to use dllexport rather than dllimport, # which is appropriate when building the dll but not consuming it. @@ -113,17 +114,17 @@ install( RUNTIME DESTINATION bin ) -ament_export_dependencies(ament_cmake) -ament_export_dependencies(builtin_interfaces) -ament_export_dependencies(rcl) -ament_export_dependencies(rosidl_generator_cpp) -ament_export_dependencies(rosidl_typesupport_c) -ament_export_dependencies(rosidl_typesupport_cpp) - +# specific order: dependents before dependencies ament_export_include_directories(include) - ament_export_libraries(${PROJECT_NAME}) +ament_export_dependencies(ament_cmake) +ament_export_dependencies(rcl) +ament_export_dependencies(builtin_interfaces) +ament_export_dependencies(rosidl_typesupport_cpp) +ament_export_dependencies(rosidl_typesupport_c) +ament_export_dependencies(rosidl_generator_cpp) + if(BUILD_TESTING) find_package(ament_cmake_gtest REQUIRED) find_package(ament_lint_auto REQUIRED) diff --git a/rclcpp_lifecycle/CMakeLists.txt b/rclcpp_lifecycle/CMakeLists.txt index 6d8de21..1862810 100644 --- a/rclcpp_lifecycle/CMakeLists.txt +++ b/rclcpp_lifecycle/CMakeLists.txt @@ -25,10 +25,11 @@ add_library(rclcpp_lifecycle src/state.cpp src/transition.cpp ) +# specific order: dependents before dependencies ament_target_dependencies(rclcpp_lifecycle - "lifecycle_msgs" + "rclcpp" "rcl_lifecycle" - "rclcpp") + "lifecycle_msgs") # Causes the visibility macros to use dllexport rather than dllimport, # which is appropriate when building the dll but not consuming it. @@ -100,11 +101,12 @@ if(BUILD_TESTING) endif() endif() +# specific order: dependents before dependencies +ament_export_include_directories(include) +ament_export_libraries(${PROJECT_NAME}) ament_export_dependencies(rclcpp) ament_export_dependencies(rcl_lifecycle) ament_export_dependencies(lifecycle_msgs) -ament_export_include_directories(include) -ament_export_libraries(${PROJECT_NAME}) ament_package() install(DIRECTORY include/