Skip to content

Commit

Permalink
Use CMake targets for eigen (#50)
Browse files Browse the repository at this point in the history
(cherry picked from commit f252dcb)
  • Loading branch information
christophfroehlich authored and mergify[bot] committed Mar 1, 2024
1 parent be5b6bf commit a16b4c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion kinematics_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Eigen3
rclcpp
rclcpp_lifecycle
)
Expand All @@ -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)
Expand All @@ -24,6 +24,9 @@ target_include_directories(kinematics_interface PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/kinematics_interface>
)
target_link_libraries(kinematics_interface PUBLIC
Eigen3::Eigen
)
ament_target_dependencies(kinematics_interface PUBLIC
${THIS_PACKAGE_INCLUDE_DEPENDS}
)
Expand Down
5 changes: 4 additions & 1 deletion kinematics_interface_kdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
Eigen3
kdl_parser
kinematics_interface
pluginlib
Expand All @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit a16b4c8

Please sign in to comment.