From a16b4c8885fbfdf2ff71b53b0c77b298ff043df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Fri, 1 Mar 2024 13:53:20 +0100 Subject: [PATCH] Use CMake targets for eigen (#50) (cherry picked from commit f252dcb8661f6f175446a2418b7805e308b3684d) --- kinematics_interface/CMakeLists.txt | 5 ++++- kinematics_interface_kdl/CMakeLists.txt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kinematics_interface/CMakeLists.txt b/kinematics_interface/CMakeLists.txt index 7decbdb..88eaf9e 100644 --- a/kinematics_interface/CMakeLists.txt +++ b/kinematics_interface/CMakeLists.txt @@ -6,7 +6,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") endif() set(THIS_PACKAGE_INCLUDE_DEPENDS - Eigen3 rclcpp rclcpp_lifecycle ) @@ -16,6 +15,7 @@ find_package(ament_cmake REQUIRED) foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS}) find_package(${Dependency} REQUIRED) endforeach() +find_package(Eigen3 REQUIRED NO_MODULE) # Create interface library for kinematics base class add_library(kinematics_interface SHARED src/kinematics_interface.cpp) @@ -24,6 +24,9 @@ target_include_directories(kinematics_interface PUBLIC $ $ ) +target_link_libraries(kinematics_interface PUBLIC + Eigen3::Eigen +) ament_target_dependencies(kinematics_interface PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS} ) diff --git a/kinematics_interface_kdl/CMakeLists.txt b/kinematics_interface_kdl/CMakeLists.txt index cf71efd..afeadae 100644 --- a/kinematics_interface_kdl/CMakeLists.txt +++ b/kinematics_interface_kdl/CMakeLists.txt @@ -6,7 +6,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") endif() set(THIS_PACKAGE_INCLUDE_DEPENDS - Eigen3 kdl_parser kinematics_interface pluginlib @@ -18,6 +17,7 @@ find_package(ament_cmake REQUIRED) foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS}) find_package(${Dependency} REQUIRED) endforeach() +find_package(Eigen3 REQUIRED NO_MODULE) add_library( kinematics_interface_kdl @@ -32,6 +32,9 @@ target_compile_features(kinematics_interface_kdl PUBLIC cxx_std_17) ament_target_dependencies(kinematics_interface_kdl PUBLIC ${THIS_PACKAGE_INCLUDE_DEPENDS} ) +target_link_libraries(kinematics_interface_kdl PUBLIC + Eigen3::Eigen +) pluginlib_export_plugin_description_file(kinematics_interface kinematics_interface_kdl.xml)