1
+ cmake_minimum_required (VERSION 2.8.3)
2
+ project (dh_gripper_driver)
3
+
4
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native " )
5
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native" )
6
+
7
+ # Check C++11 or C++0x support
8
+ include (CheckCXXCompilerFlag)
9
+ CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
10
+ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
11
+ if (COMPILER_SUPPORTS_CXX11)
12
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
13
+ add_definitions (-DCOMPILEDWITHC11)
14
+ message (STATUS "Using flag -std=c++11." )
15
+ elseif (COMPILER_SUPPORTS_CXX0X)
16
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x" )
17
+ add_definitions (-DCOMPILEDWITHC0X)
18
+ message (STATUS "Using flag -std=c++0x." )
19
+ else ()
20
+ message (FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler." )
21
+ endif ()
22
+
23
+
24
+ ## System dependencies are found with CMake's conventions
25
+ find_package (catkin REQUIRED COMPONENTS
26
+ roscpp
27
+ rospy
28
+ std_msgs
29
+ dh_gripper_msgs
30
+ sensor_msgs
31
+ )
32
+
33
+ ## Uncomment this if the package has a setup.py. This macro ensures
34
+ ## modules and global scripts declared therein get installed
35
+ ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
36
+ # catkin_python_setup()
37
+
38
+ ################################################
39
+ ## Declare ROS messages, services and actions ##
40
+ ################################################
41
+
42
+ ## To declare and build messages, services or actions from within this
43
+ ## package, follow these steps:
44
+ ## * Let MSG_DEP_SET be the set of packages whose message types you use in
45
+ ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
46
+ ## * In the file package.xml:
47
+ ## * add a build_depend tag for "message_generation"
48
+ ## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
49
+ ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
50
+ ## but can be declared for certainty nonetheless:
51
+ ## * add a exec_depend tag for "message_runtime"
52
+ ## * In this file (CMakeLists.txt):
53
+ ## * add "message_generation" and every package in MSG_DEP_SET to
54
+ ## find_package(catkin REQUIRED COMPONENTS ...)
55
+ ## * add "message_runtime" and every package in MSG_DEP_SET to
56
+ ## catkin_package(CATKIN_DEPENDS ...)
57
+ ## * uncomment the add_*_files sections below as needed
58
+ ## and list every .msg/.srv/.action file to be processed
59
+ ## * uncomment the generate_messages entry below
60
+ ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
61
+
62
+ ## Generate messages in the 'msg' folder
63
+ # add_message_files(
64
+ # FILES
65
+ # Message1.msg
66
+ # Message2.msg
67
+ # )
68
+
69
+ ## Generate services in the 'srv' folder
70
+ # add_service_files(
71
+ # FILES
72
+ # Service1.srv
73
+ # Service2.srv
74
+ # )
75
+
76
+ ## Generate actions in the 'action' folder
77
+ # add_action_files(
78
+ # FILES
79
+ # Action1.action
80
+ # Action2.action
81
+ # )
82
+
83
+ ## Generate added messages and services with any dependencies listed here
84
+ # generate_messages(
85
+ # DEPENDENCIES
86
+ # std_msgs
87
+ # )
88
+
89
+ ################################################
90
+ ## Declare ROS dynamic reconfigure parameters ##
91
+ ################################################
92
+
93
+ ## To declare and build dynamic reconfigure parameters within this
94
+ ## package, follow these steps:
95
+ ## * In the file package.xml:
96
+ ## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
97
+ ## * In this file (CMakeLists.txt):
98
+ ## * add "dynamic_reconfigure" to
99
+ ## find_package(catkin REQUIRED COMPONENTS ...)
100
+ ## * uncomment the "generate_dynamic_reconfigure_options" section below
101
+ ## and list every .cfg file to be processed
102
+
103
+ ## Generate dynamic reconfigure parameters in the 'cfg' folder
104
+ # generate_dynamic_reconfigure_options(
105
+ # cfg/DynReconf1.cfg
106
+ # cfg/DynReconf2.cfg
107
+ # )
108
+
109
+ ###################################
110
+ ## catkin specific configuration ##
111
+ ###################################
112
+ ## The catkin_package macro generates cmake config files for your package
113
+ ## Declare things to be passed to dependent projects
114
+ ## INCLUDE_DIRS: uncomment this if your package contains header files
115
+ ## LIBRARIES: libraries you create in this project that dependent projects also need
116
+ ## CATKIN_DEPENDS: catkin_packages dependent projects also need
117
+ ## DEPENDS: system dependencies of this project that dependent projects also need
118
+ catkin_package(
119
+ INCLUDE_DIRS include
120
+ CATKIN_DEPENDS
121
+ roscpp
122
+ rospy
123
+ std_msgs
124
+ )
125
+
126
+ ###########
127
+ ## Build ##
128
+ ###########
129
+
130
+ ## Specify additional locations of header files
131
+ ## Your package locations should be listed before other locations
132
+ include_directories (
133
+ ${catkin_INCLUDE_DIRS}
134
+ include
135
+ include /dh_gripper_driver/include
136
+ )
137
+
138
+ ## Declare a C++ library
139
+ # add_library(${PROJECT_NAME}
140
+ # src/${PROJECT_NAME}/dh_gripper_driver.cpp
141
+ # )
142
+
143
+ ## Add cmake target dependencies of the library
144
+ ## as an example, code may need to be generated before libraries
145
+ ## either from message generation or dynamic reconfigure
146
+ # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
147
+
148
+
149
+ ## Declare a C++ executable
150
+ ## With catkin_make all packages are built within a single CMake context
151
+ ## The recommended prefix ensures that target names across packages don't collide
152
+ # add_executable(${PROJECT_NAME}_node src/dh_gripper_driver_node.cpp)
153
+ add_executable (dh_gripper_driver
154
+ include /dh_gripper_driver/src/dh_device.cpp
155
+ include /dh_gripper_driver/src/dh_ag95_can.cpp
156
+ include /dh_gripper_driver/src/dh_dh3_can.cpp
157
+ include /dh_gripper_driver/src/dh_lagacy_gripper.cpp
158
+ include /dh_gripper_driver/src/dh_modbus_gripper.cpp
159
+ include /dh_gripper_driver/src/dh_rgi.cpp
160
+ src/dh_gripper_driver.cpp)
161
+
162
+ add_executable (dh_gripper_driver_test
163
+ src/dh_gripper_Test.cpp)
164
+ ## Rename C++ executable without prefix
165
+ ## The above recommended prefix causes long target names, the following renames the
166
+ ## target back to the shorter version for ease of user use
167
+ ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
168
+ # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
169
+
170
+ ## Add cmake target dependencies of the executable
171
+ ## same as for the library above
172
+ # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
173
+
174
+ ## Specify libraries to link a library or executable target against
175
+ # target_link_libraries(${PROJECT_NAME}_node
176
+ # ${catkin_LIBRARIES}
177
+ # )
178
+
179
+ #############
180
+ ## Install ##
181
+ #############
182
+
183
+ # all install targets should use catkin DESTINATION variables
184
+ # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
185
+
186
+ ## Mark executable scripts (Python etc.) for installation
187
+ ## in contrast to setup.py, you can choose the destination
188
+ # install(PROGRAMS
189
+ # scripts/my_python_script
190
+ # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
191
+ # )
192
+
193
+ ## Mark executables and/or libraries for installation
194
+ # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
195
+ # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
196
+ # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
197
+ # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
198
+ # )
199
+
200
+ ## Mark cpp header files for installation
201
+ # install(DIRECTORY include/${PROJECT_NAME}/
202
+ # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
203
+ # FILES_MATCHING PATTERN "*.h"
204
+ # PATTERN ".svn" EXCLUDE
205
+ # )
206
+
207
+ ## Mark other files for installation (e.g. launch and bag files, etc.)
208
+ # install(FILES
209
+ # # myfile1
210
+ # # myfile2
211
+ # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
212
+ # )
213
+
214
+ #############
215
+ ## Testing ##
216
+ #############
217
+
218
+ ## Add gtest based cpp test target and link libraries
219
+ # catkin_add_gtest(${PROJECT_NAME}-test test/test_dh_gripper_driver.cpp)
220
+ # if(TARGET ${PROJECT_NAME}-test)
221
+ # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
222
+ # endif()
223
+ target_link_libraries (dh_gripper_driver
224
+ ${catkin_LIBRARIES} )
225
+
226
+ target_link_libraries (dh_gripper_driver_test
227
+ ${catkin_LIBRARIES} )
228
+ ## Add folders to be run by python nosetests
229
+ # catkin_add_nosetests(test)
0 commit comments