check system processor and set libunitree_legged_sdk.so

This commit is contained in:
Kei Okada 2022-03-29 17:09:17 +09:00
parent 3c0fe3c97d
commit 8528fde230
1 changed files with 8 additions and 2 deletions

View File

@ -21,7 +21,13 @@ set(CMAKE_CXX_FLAGS "-O3")
include_directories(/home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/include) include_directories(/home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/include)
link_directories(/home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/lib) link_directories(/home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/lib)
string(CONCAT LEGGED_SDK_NAME libunitree_legged_sdk_amd64.so) message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64.*")
set(ARCH amd64)
else()
set(ARCH arm64)
endif()
string(CONCAT LEGGED_SDK_NAME libunitree_legged_sdk_${ARCH}.so)
set(EXTRA_LIBS ${LEGGED_SDK_NAME} lcm) set(EXTRA_LIBS ${LEGGED_SDK_NAME} lcm)
add_executable(lcm_server /home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/examples/lcm_server.cpp) add_executable(lcm_server /home/$ENV{USER}/Robot_SDK/unitree_legged_sdk/examples/lcm_server.cpp)
@ -42,4 +48,4 @@ add_dependencies(torque_lcm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTE
add_executable(walk_lcm src/exe/walk_mode.cpp) add_executable(walk_lcm src/exe/walk_mode.cpp)
target_link_libraries(walk_lcm ${EXTRA_LIBS} ${catkin_LIBRARIES}) target_link_libraries(walk_lcm ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_dependencies(walk_lcm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) add_dependencies(walk_lcm ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})