Skip to content

Commit 0b0c71d

Browse files
authored
Update CMakeLists.txt
1 parent 762d91c commit 0b0c71d

File tree

1 file changed

+31
-67
lines changed

1 file changed

+31
-67
lines changed
Lines changed: 31 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,73 @@
1+
################################################################################
2+
# Set minimum required version of cmake, project name and compile options
3+
################################################################################
14
cmake_minimum_required(VERSION 2.8.3)
25
project(dynamixel_sdk_examples)
36

47
## Compile as C++11, supported in ROS Kinetic and newer
58
add_compile_options(-std=c++11)
69

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
1519
)
1620

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+
################################################################################
4524
## Generate messages in the 'msg' folder
4625
add_message_files(
4726
FILES
48-
SetPosition.msg
27+
SetPosition.msg
4928
)
5029

5130
## Generate services in the 'srv' folder
5231
add_service_files(
5332
FILES
54-
GetPosition.srv
33+
GetPosition.srv
5534
)
5635

5736
## Generate added messages and services with any dependencies listed here
5837
generate_messages(
5938
DEPENDENCIES
60-
std_msgs
39+
std_msgs
6140
)
6241

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+
################################################################################
7345
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
7650
# DEPENDS system_lib
7751
)
7852

79-
###########
80-
## Build ##
81-
###########
82-
53+
################################################################################
54+
# Build
55+
################################################################################
8356
## Specify additional locations of header files
8457
## Your package locations should be listed before other locations
8558
include_directories(
86-
include
8759
${catkin_INCLUDE_DIRS}
8860
)
8961

9062
add_executable(read_write_node src/read_write_node.cpp)
9163
add_dependencies(read_write_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
9264
target_link_libraries(read_write_node ${catkin_LIBRARIES})
9365

94-
#############
95-
## Install ##
96-
#############
97-
66+
################################################################################
67+
# Install
68+
################################################################################
9869
## Mark executables for installation
9970
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
10071
install(TARGETS read_write_node
10172
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
10273
)
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

Comments
 (0)