forked from empriselab/kortex_hardware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (93 loc) · 2.52 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 3.0.2)
project(kortex_hardware)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
add_definitions(-D_OS_UNIX)
find_package(catkin REQUIRED COMPONENTS
std_msgs
roscpp
controller_manager
hardware_interface
sensor_msgs
message_generation
)
find_package(Boost REQUIRED COMPONENTS system)
find_package(Eigen3 REQUIRED)
find_package(pinocchio REQUIRED)
link_directories(${PROJECT_SOURCE_DIR}/lib/release)
link_directories()
#############
## Msg/Srv ##
#############
add_service_files(
FILES
ModeService.srv
)
generate_messages(
DEPENDENCIES
std_msgs
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS
include
CATKIN_DEPENDS
std_msgs
roscpp
controller_manager
hardware_interface
sensor_msgs
)
##################
## Clang-format ##
##################
include(ClangFormat.cmake)
file(GLOB_RECURSE FILES
${PROJECT_SOURCE_DIR}/src/*.[ch]pp
)
file(GLOB FILES_INCLUDE
${PROJECT_SOURCE_DIR}/include/*.h
)
set(FILES ${FILES} ${FILES_INCLUDE})
clang_format_setup(VERSION 10)
if (CLANG_FORMAT_EXECUTABLE)
clang_format_add_sources(${FILES})
clang_format_add_targets()
endif()
###########
## Build ##
###########
include_directories(
include
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${libkindrv_INCLUDE_DIRS}
${pinocchio_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include/client
${PROJECT_SOURCE_DIR}/include/client_stubs
${PROJECT_SOURCE_DIR}/include/messages
${PROJECT_SOURCE_DIR}/include/common
)
add_executable(kortex_hardware src/main.cpp src/Gen3Robot.cpp src/LowPassFilter.cpp)
set(KINOVA_ARM_LIBS ${catkin_LIBRARIES})
set(KINOVA_ARM_LIBS
${KINOVA_ARM_LIBS}
-l:libKortexApiCpp_without_protobuf.a
-l:libKortexApiCpp.a)
## Specify libraries to link a library or executable target against
target_link_libraries(kortex_hardware
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${pinocchio_LIBRARIES}
${KINOVA_ARM_LIBS}
)