-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
79 lines (63 loc) · 1.53 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
cmake_minimum_required(VERSION 3.5)
project(interbotix_xs_driver LANGUAGES CXX)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
find_package(dynamixel_workbench_toolbox REQUIRED)
find_package(yaml-cpp REQUIRED)
include_directories(include)
set(DEPENDENCIES
dynamixel_workbench_toolbox
)
# Generate version header file from package.xml
include(cmake/Version.cmake)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
add_library(
${PROJECT_NAME} SHARED
src/xs_driver.cpp
src/xs_logging.cpp
)
ament_target_dependencies(${PROJECT_NAME} ${DEPENDENCIES})
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(${PROJECT_NAME} yaml-cpp)
install(
TARGETS ${PROJECT_NAME}
EXPORT "export_${PROJECT_NAME}"
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
INCLUDES DESTINATION include
)
install(
FILES
${PATH_TO_VERSION_OUTPUT}
DESTINATION
include/${PROJECT_NAME}
)
install(
DIRECTORY
include/${PROJECT_NAME}/
DESTINATION
include/${PROJECT_NAME}
)
install(
FILES
package.xml
DESTINATION
share/${PROJECT_NAME}
)
ament_export_dependencies(
yaml-cpp
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_export_targets("export_${PROJECT_NAME}")
ament_package()