Skip to content

Commit d2cafc8

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

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

cmake/Findpinocchio.cmake

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ if (NOT pinocchio_FOUND)
2727
return()
2828
endif()
2929

30-
# Extract version from the library filename
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+
40+
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)
3343
string(REPLACE "pin-" "" pinocchio_VERSION "${pinocchio_library_filename}")
@@ -39,7 +49,7 @@ if (NOT pinocchio_FOUND)
3949
set_target_properties(
4050
pinocchio::pinocchio
4151
PROPERTIES
42-
IMPORTED_LOCATION "${pinocchio_library_path}"
52+
IMPORTED_LOCATION "${pinocchio_library_path}" "${pinocchio_parsers_path}"
4353
)
4454
set(pinocchio_FOUND TRUE)
4555
endif()

0 commit comments

Comments
 (0)