-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (47 loc) · 1.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 3.12.0)
project(wolf_unitree_interface)
set(CMAKE_CXX_FLAGS "-O3 -fPIC")
add_compile_options(-std=c++11)
# Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
controller_manager
realtime_tools
wolf_hardware_interface
)
message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64.*")
set(ARCH amd64)
else()
set(ARCH arm64)
endif()
set(EXTRA_LIBS -pthread libunitree_legged_sdk_${ARCH}.so lcm)
catkin_package(
CATKIN_DEPENDS
controller_manager
realtime_tools
wolf_hardware_interface
LIBRARIES unitree_hal
)
##########
# Build ##
##########
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(unitree_hal src/unitree_hal.cpp)
target_link_libraries(unitree_hal ${EXTRA_LIBS} ${catkin_LIBRARIES})
add_executable(unitree_ros_node
src/unitree_robot_hw.cpp
src/unitree_ros_control.cpp
src/unitree_ros_node.cpp)
target_link_libraries(unitree_ros_node ${catkin_LIBRARIES} unitree_hal)
#############
## Install ##
#############
install(
TARGETS unitree_hal unitree_ros_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)