CMakeLists.txt 7.3 KB

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