diff --git a/draco_point_cloud_transport/CMakeLists.txt b/draco_point_cloud_transport/CMakeLists.txt index f80ba2b..044d50b 100644 --- a/draco_point_cloud_transport/CMakeLists.txt +++ b/draco_point_cloud_transport/CMakeLists.txt @@ -16,17 +16,16 @@ find_package(std_msgs REQUIRED) find_package(Draco REQUIRED) set(dependencies - pluginlib - point_cloud_interfaces - point_cloud_transport - rclcpp - rcpputils - sensor_msgs - std_msgs + pluginlib::pluginlib + ${point_cloud_interfaces_TARGETS} + point_cloud_transport::point_cloud_transport + rclcpp::rclcpp + rcpputils::rcpputils + ${sensor_msgs_TARGETS} + ${std_msgs_TARGETS} ) - -include_directories(include ${DRACO_INCLUDE_DIR}) +include_directories(include) add_library(${PROJECT_NAME} SHARED @@ -36,9 +35,15 @@ add_library(${PROJECT_NAME} src/manifest.cpp ) -target_link_libraries(${PROJECT_NAME} ${DRACO_LIBRARY}) - -ament_target_dependencies(${PROJECT_NAME} ${dependencies}) +target_link_libraries(${PROJECT_NAME} PRIVATE + ${DRACO_LIBRARY} + ${dependencies} +) +target_include_directories(${PROJECT_NAME} PRIVATE + "$" + "$" + ${DRACO_INCLUDE_DIR} +) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib diff --git a/plugin_template/CMakeLists.txt b/plugin_template/CMakeLists.txt index 2751011..2b9fb06 100644 --- a/plugin_template/CMakeLists.txt +++ b/plugin_template/CMakeLists.txt @@ -1,4 +1,4 @@ -# TODO (YourNameHere): This is not a working CMake Project! +# TODO (YourNameHere): This is not a working CMake Project! # Some assembly required for your plugin. (-: cmake_minimum_required(VERSION 3.10.2) @@ -15,13 +15,15 @@ find_package(rclcpp REQUIRED) # TODO (YourNameHere): You might need more dependencies set(dependencies - pluginlib - point_cloud_interfaces - point_cloud_transport - rclcpp + pluginlib::pluginlib + ${point_cloud_interfaces_TARGETS} + point_cloud_transport::point_cloud_transport + rclcpp::rclcpp ) -include_directories(include) +target_include_directories(${PROJECT_NAME} PRIVATE + "$" + "$") add_library(${PROJECT_NAME} SHARED @@ -31,7 +33,9 @@ add_library(${PROJECT_NAME} src/template_subscriber.cpp ) -ament_target_dependencies(${PROJECT_NAME} ${dependencies}) +target_link_libraries(${PROJECT_NAME} PRIVATE + ${dependencies} +) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib diff --git a/zlib_point_cloud_transport/CMakeLists.txt b/zlib_point_cloud_transport/CMakeLists.txt index 907a56a..835e4ff 100644 --- a/zlib_point_cloud_transport/CMakeLists.txt +++ b/zlib_point_cloud_transport/CMakeLists.txt @@ -12,15 +12,12 @@ find_package(rclcpp REQUIRED) find_package(ZLIB REQUIRED) set(dependencies - pluginlib - point_cloud_interfaces - point_cloud_transport - rclcpp + pluginlib::pluginlib + ${point_cloud_interfaces_TARGETS} + point_cloud_transport::point_cloud_transport + rclcpp::rclcpp ) - -include_directories(include) - add_library(${PROJECT_NAME} SHARED src/zlib_publisher.cpp @@ -29,9 +26,14 @@ add_library(${PROJECT_NAME} src/manifest.cpp ) -target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) - -ament_target_dependencies(${PROJECT_NAME} ${dependencies}) +target_link_libraries(${PROJECT_NAME} PRIVATE + ZLIB::ZLIB + ${dependencies} +) +target_include_directories(${PROJECT_NAME} PRIVATE + "$" + "$" +) install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib diff --git a/zstd_point_cloud_transport/CMakeLists.txt b/zstd_point_cloud_transport/CMakeLists.txt index b38dd9d..4efac77 100644 --- a/zstd_point_cloud_transport/CMakeLists.txt +++ b/zstd_point_cloud_transport/CMakeLists.txt @@ -11,14 +11,12 @@ find_package(point_cloud_transport REQUIRED) find_package(rclcpp REQUIRED) set(dependencies - pluginlib - point_cloud_interfaces - point_cloud_transport - rclcpp + pluginlib::pluginlib + ${point_cloud_interfaces_TARGETS} + point_cloud_transport::point_cloud_transport + rclcpp::rclcpp ) -include_directories(include) - add_library(${PROJECT_NAME} SHARED src/zstd_publisher.cpp @@ -26,9 +24,14 @@ add_library(${PROJECT_NAME} src/manifest.cpp ) -target_link_libraries(${PROJECT_NAME} zstd) +target_link_libraries(${PROJECT_NAME} PRIVATE + zstd + ${dependencies} +) -ament_target_dependencies(${PROJECT_NAME} ${dependencies}) +target_include_directories(${PROJECT_NAME} PRIVATE + "$" + "$") install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib