Advertisement
Guest User

Untitled

a guest
Oct 24th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 6.88 KB | None | 0 0
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(assign2)
  3.  
  4. ## Compile as C++11, supported in ROS Kinetic and newer
  5. # add_compile_options(-std=c++11)
  6.  
  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.         roslib
  12.         roscpp
  13.         tf
  14.         stdr_msgs
  15.         geometry_msgs
  16.         sensor_msgs
  17.         nav_msgs)
  18.  
  19. ## System dependencies are found with CMake's conventions
  20. # find_package(Boost REQUIRED COMPONENTS system)
  21.  
  22.  
  23. ## Uncomment this if the package has a setup.py. This macro ensures
  24. ## modules and global scripts declared therein get installed
  25. ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
  26. # catkin_python_setup()
  27.  
  28. ################################################
  29. ## Declare ROS messages, services and actions ##
  30. ################################################
  31.  
  32. ## To declare and build messages, services or actions from within this
  33. ## package, follow these steps:
  34. ## * Let MSG_DEP_SET be the set of packages whose message types you use in
  35. ##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
  36. ## * In the file package.xml:
  37. ##   * add a build_depend tag for "message_generation"
  38. ##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
  39. ##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
  40. ##     but can be declared for certainty nonetheless:
  41. ##     * add a exec_depend tag for "message_runtime"
  42. ## * In this file (CMakeLists.txt):
  43. ##   * add "message_generation" and every package in MSG_DEP_SET to
  44. ##     find_package(catkin REQUIRED COMPONENTS ...)
  45. ##   * add "message_runtime" and every package in MSG_DEP_SET to
  46. ##     catkin_package(CATKIN_DEPENDS ...)
  47. ##   * uncomment the add_*_files sections below as needed
  48. ##     and list every .msg/.srv/.action file to be processed
  49. ##   * uncomment the generate_messages entry below
  50. ##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
  51.  
  52. ## Generate messages in the 'msg' folder
  53. # add_message_files(
  54. #   FILES
  55. #   Message1.msg
  56. #   Message2.msg
  57. # )
  58.  
  59. ## Generate services in the 'srv' folder
  60. # add_service_files(
  61. #   FILES
  62. #   Service1.srv
  63. #   Service2.srv
  64. # )
  65.  
  66. ## Generate actions in the 'action' folder
  67. # add_action_files(
  68. #   FILES
  69. #   Action1.action
  70. #   Action2.action
  71. # )
  72.  
  73. ## Generate added messages and services with any dependencies listed here
  74. # generate_messages(
  75. #   DEPENDENCIES
  76. #   std_msgs  # Or other packages containing msgs
  77. # )
  78.  
  79. ################################################
  80. ## Declare ROS dynamic reconfigure parameters ##
  81. ################################################
  82.  
  83. ## To declare and build dynamic reconfigure parameters within this
  84. ## package, follow these steps:
  85. ## * In the file package.xml:
  86. ##   * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
  87. ## * In this file (CMakeLists.txt):
  88. ##   * add "dynamic_reconfigure" to
  89. ##     find_package(catkin REQUIRED COMPONENTS ...)
  90. ##   * uncomment the "generate_dynamic_reconfigure_options" section below
  91. ##     and list every .cfg file to be processed
  92.  
  93. ## Generate dynamic reconfigure parameters in the 'cfg' folder
  94. # generate_dynamic_reconfigure_options(
  95. #   cfg/DynReconf1.cfg
  96. #   cfg/DynReconf2.cfg
  97. # )
  98.  
  99. ###################################
  100. ## catkin specific configuration ##
  101. ###################################
  102. ## The catkin_package macro generates cmake config files for your package
  103. ## Declare things to be passed to dependent projects
  104. ## INCLUDE_DIRS: uncomment this if your package contains header files
  105. ## LIBRARIES: libraries you create in this project that dependent projects also need
  106. ## CATKIN_DEPENDS: catkin_packages dependent projects also need
  107. ## DEPENDS: system dependencies of this project that dependent projects also need
  108. catkin_package(
  109. #  INCLUDE_DIRS include
  110. #  LIBRARIES assign2
  111. #  CATKIN_DEPENDS other_catkin_pkg
  112. #  DEPENDS system_lib
  113.         INCLUDE_DIRS
  114.         .
  115.         LIBRARIES
  116.         CATKIN_DEPENDS
  117.         roslib
  118.         roscpp
  119.         tf
  120.         stdr_msgs
  121.         geometry_msgs
  122.         sensor_msgs
  123.         nav_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(include ${catkin_INCLUDE_DIRS})
  133.  
  134. ## Declare a C++ library
  135. # add_library(${PROJECT_NAME}
  136. #   src/${PROJECT_NAME}/assign2.cpp
  137. # )
  138.  
  139. ## Add cmake target dependencies of the library
  140. ## as an example, code may need to be generated before libraries
  141. ## either from message generation or dynamic reconfigure
  142. # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
  143.  
  144. ## Declare a C++ executable
  145. ## With catkin_make all packages are built within a single CMake context
  146. ## The recommended prefix ensures that target names across packages don't collide
  147. add_executable(hello hello.cpp MyRobot.cpp MyRobot.h)
  148.  
  149. ## Rename C++ executable without prefix
  150. ## The above recommended prefix causes long target names, the following renames the
  151. ## target back to the shorter version for ease of user use
  152. ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
  153. # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
  154.  
  155. ## Add cmake target dependencies of the executable
  156. ## same as for the library above
  157. add_dependencies(hello ${stdr_msgs_EXPORTED_TARGETS})
  158.  
  159. ## Specify libraries to link a library or executable target against
  160. target_link_libraries(hello ${catkin_LIBRARIES})
  161.  
  162. #############
  163. ## Install ##
  164. #############
  165.  
  166. # all install targets should use catkin DESTINATION variables
  167. # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
  168.  
  169. ## Mark executable scripts (Python etc.) for installation
  170. ## in contrast to setup.py, you can choose the destination
  171. # install(PROGRAMS
  172. #   scripts/my_python_script
  173. #   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  174. # )
  175.  
  176. ## Mark executables and/or libraries for installation
  177.  install(TARGETS hello
  178.    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  179.  )
  180.  
  181. ## Mark cpp header files for installation
  182. # install(DIRECTORY include/${PROJECT_NAME}/
  183. #   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  184. #   FILES_MATCHING PATTERN "*.h"
  185. #   PATTERN ".svn" EXCLUDE
  186. # )
  187.  
  188. ## Mark other files for installation (e.g. launch and bag files, etc.)
  189. # install(FILES
  190. #   # myfile1
  191. #   # myfile2
  192. #   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  193. # )
  194.  
  195. #############
  196. ## Testing ##
  197. #############
  198.  
  199. ## Add gtest based cpp test target and link libraries
  200. # catkin_add_gtest(${PROJECT_NAME}-test test/test_assign2.cpp)
  201. # if(TARGET ${PROJECT_NAME}-test)
  202. #   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
  203. # endif()
  204.  
  205. ## Add folders to be run by python nosetests
  206. # catkin_add_nosetests(test)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement