Skip to content

Commit 686babe

Browse files
committed
fix(cmake): added pinocchio parsers
1 parent 2b61347 commit 686babe

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

cmake/Findpinocchio.cmake

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ if (NOT pinocchio_FOUND)
2727
return()
2828
endif()
2929

30+
# Check if the library file exists
31+
cmake_path(APPEND Python3_SITELIB cmeel.prefix lib libpinocchio_parsers.so OUTPUT_VARIABLE pinocchio_parsers_path)
32+
if (NOT EXISTS ${pinocchio_parsers_path})
33+
set(pinocchio_FOUND FALSE)
34+
if (pinocchio_FIND_REQUIRED)
35+
message(FATAL_ERROR "Could not find pinocchio parsers path. Please install pinocchio using pip.")
36+
endif()
37+
return()
38+
endif()
39+
3040
# Extract version from the library filename
3141
file(GLOB pinocchio_dist_info "${Python3_SITELIB}/pin-*.dist-info")
3242
cmake_path(GET pinocchio_dist_info FILENAME pinocchio_library_filename)
@@ -38,8 +48,17 @@ if (NOT pinocchio_FOUND)
3848
target_include_directories(pinocchio::pinocchio INTERFACE ${pinocchio_INCLUDE_DIRS})
3949
set_target_properties(
4050
pinocchio::pinocchio
41-
PROPERTIES
51+
PROPERTIES
4252
IMPORTED_LOCATION "${pinocchio_library_path}"
4353
)
54+
55+
add_library(pinocchio_parsers SHARED IMPORTED)
56+
target_include_directories(pinocchio_parsers INTERFACE ${pinocchio_INCLUDE_DIRS})
57+
set_target_properties(
58+
pinocchio_parsers
59+
PROPERTIES
60+
IMPORTED_LOCATION "${pinocchio_parsers_path}"
61+
)
4462
set(pinocchio_FOUND TRUE)
63+
4564
endif()

src/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
add_library(common)
22
target_sources(common PRIVATE Pose.cpp Robot.cpp IK.cpp utils.cpp)
3-
target_link_libraries(common PUBLIC Eigen3::Eigen mdl pinocchio::pinocchio)
3+
target_link_libraries(common PUBLIC Eigen3::Eigen mdl pinocchio::pinocchio pinocchio_parsers)

0 commit comments

Comments
 (0)