CMakeLists.txt 6.9 KB

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