|
| 1 | +################################################################################ |
| 2 | +# Set minimum required version of cmake, project name and compile options |
| 3 | +################################################################################ |
1 | 4 | cmake_minimum_required(VERSION 2.8.3) |
2 | 5 | project(dynamixel_sdk_examples) |
3 | 6 |
|
4 | 7 | ## Compile as C++11, supported in ROS Kinetic and newer |
5 | 8 | add_compile_options(-std=c++11) |
6 | 9 |
|
7 | | -## Find catkin macros and libraries |
8 | | -## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) |
9 | | -## is used, also find other catkin packages |
10 | | -find_package(catkin REQUIRED COMPONENTS |
11 | | - roscpp |
12 | | - std_msgs |
13 | | - message_generation |
14 | | - dynamixel_sdk |
| 10 | +################################################################################ |
| 11 | +# Find catkin packages and libraries for catkin and system dependencies |
| 12 | +################################################################################ |
| 13 | +find_package(catkin REQUIRED |
| 14 | + COMPONENTS |
| 15 | + roscpp |
| 16 | + std_msgs |
| 17 | + message_generation |
| 18 | + dynamixel_sdk |
15 | 19 | ) |
16 | 20 |
|
17 | | -## System dependencies are found with CMake's conventions |
18 | | -# find_package(Boost REQUIRED COMPONENTS system) |
19 | | - |
20 | | - |
21 | | -################################################ |
22 | | -## Declare ROS messages, services and actions ## |
23 | | -################################################ |
24 | | - |
25 | | -## To declare and build messages, services or actions from within this |
26 | | -## package, follow these steps: |
27 | | -## * Let MSG_DEP_SET be the set of packages whose message types you use in |
28 | | -## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). |
29 | | -## * In the file package.xml: |
30 | | -## * add a build_depend tag for "message_generation" |
31 | | -## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET |
32 | | -## * If MSG_DEP_SET isn't empty the following dependency has been pulled in |
33 | | -## but can be declared for certainty nonetheless: |
34 | | -## * add a exec_depend tag for "message_runtime" |
35 | | -## * In this file (CMakeLists.txt): |
36 | | -## * add "message_generation" and every package in MSG_DEP_SET to |
37 | | -## find_package(catkin REQUIRED COMPONENTS ...) |
38 | | -## * add "message_runtime" and every package in MSG_DEP_SET to |
39 | | -## catkin_package(CATKIN_DEPENDS ...) |
40 | | -## * uncomment the add_*_files sections below as needed |
41 | | -## and list every .msg/.srv/.action file to be processed |
42 | | -## * uncomment the generate_messages entry below |
43 | | -## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) |
44 | | - |
| 21 | +################################################################################ |
| 22 | +# Declare ROS messages, services and actions |
| 23 | +################################################################################ |
45 | 24 | ## Generate messages in the 'msg' folder |
46 | 25 | add_message_files( |
47 | 26 | FILES |
48 | | - SetPosition.msg |
| 27 | + SetPosition.msg |
49 | 28 | ) |
50 | 29 |
|
51 | 30 | ## Generate services in the 'srv' folder |
52 | 31 | add_service_files( |
53 | 32 | FILES |
54 | | - GetPosition.srv |
| 33 | + GetPosition.srv |
55 | 34 | ) |
56 | 35 |
|
57 | 36 | ## Generate added messages and services with any dependencies listed here |
58 | 37 | generate_messages( |
59 | 38 | DEPENDENCIES |
60 | | - std_msgs |
| 39 | + std_msgs |
61 | 40 | ) |
62 | 41 |
|
63 | | - |
64 | | -################################### |
65 | | -## catkin specific configuration ## |
66 | | -################################### |
67 | | -## The catkin_package macro generates cmake config files for your package |
68 | | -## Declare things to be passed to dependent projects |
69 | | -## INCLUDE_DIRS: uncomment this if your package contains header files |
70 | | -## LIBRARIES: libraries you create in this project that dependent projects also need |
71 | | -## CATKIN_DEPENDS: catkin_packages dependent projects also need |
72 | | -## DEPENDS: system dependencies of this project that dependent projects also need |
| 42 | +################################################################################ |
| 43 | +# Declare catkin specific configuration to be passed to dependent projects |
| 44 | +################################################################################ |
73 | 45 | catkin_package( |
74 | | - INCLUDE_DIRS include |
75 | | - CATKIN_DEPENDS roscpp std_msgs dynamixel_sdk |
| 46 | + CATKIN_DEPENDS |
| 47 | + roscpp |
| 48 | + std_msgs |
| 49 | + dynamixel_sdk |
76 | 50 | # DEPENDS system_lib |
77 | 51 | ) |
78 | 52 |
|
79 | | -########### |
80 | | -## Build ## |
81 | | -########### |
82 | | - |
| 53 | +################################################################################ |
| 54 | +# Build |
| 55 | +################################################################################ |
83 | 56 | ## Specify additional locations of header files |
84 | 57 | ## Your package locations should be listed before other locations |
85 | 58 | include_directories( |
86 | | - include |
87 | 59 | ${catkin_INCLUDE_DIRS} |
88 | 60 | ) |
89 | 61 |
|
90 | 62 | add_executable(read_write_node src/read_write_node.cpp) |
91 | 63 | add_dependencies(read_write_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) |
92 | 64 | target_link_libraries(read_write_node ${catkin_LIBRARIES}) |
93 | 65 |
|
94 | | -############# |
95 | | -## Install ## |
96 | | -############# |
97 | | - |
| 66 | +################################################################################ |
| 67 | +# Install |
| 68 | +################################################################################ |
98 | 69 | ## Mark executables for installation |
99 | 70 | ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html |
100 | 71 | install(TARGETS read_write_node |
101 | 72 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} |
102 | 73 | ) |
103 | | - |
104 | | -## Mark other files for installation (e.g. launch and bag files, etc.) |
105 | | -install(DIRECTORY launch |
106 | | - # myfile1 |
107 | | - # myfile2 |
108 | | - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} |
109 | | -) |
0 commit comments