CMakeLists.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. project(measure_wj_proj)
  2. cmake_minimum_required(VERSION 3.5)
  3. set (CMAKE_CXX_STANDARD 14)
  4. set(CMAKE_BUILD_TYPE "Release")
  5. # set(PCL_DIR "/home/youchen/pcl-1.8/share/pcl-1.8")
  6. #nanomsg
  7. find_package(PkgConfig REQUIRED)
  8. pkg_check_modules(nanomsg REQUIRED nanomsg)
  9. #yaml
  10. pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
  11. find_path(YAML_CPP_INCLUDE_DIR
  12. NAMES yaml_cpp.h
  13. PATHS ${YAML_CPP_INCLUDE_DIRS})
  14. find_library(YAML_CPP_LIBRARY
  15. NAMES YAML_CPP
  16. PATHS ${YAML_CPP_LIBRARY_DIRS})
  17. link_directories(${YAML_CPP_LIBRARY_DIRS})
  18. if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5")
  19. add_definitions(-DHAVE_NEW_YAMLCPP)
  20. endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5")
  21. # MESSAGE(WARNING ${YAML_CPP_VERSION} ${YAML_CPP_INCLUDE_DIRS} ${YAML_CPP_LIBRARY_DIRS})
  22. #other libs
  23. FIND_PACKAGE(Protobuf REQUIRED)
  24. # FIND_PACKAGE(Glog REQUIRED)
  25. FIND_PACKAGE(OpenCV REQUIRED)
  26. FIND_PACKAGE(PCL REQUIRED)
  27. FIND_PACKAGE(Ceres REQUIRED)
  28. add_subdirectory(${PROJECT_SOURCE_DIR}/rslidar/rs_driver)
  29. find_package(rs_driver REQUIRED)
  30. MESSAGE(WARN "pcl:: ${PCL_INCLUDE_DIRS} --- ${PCL_LIBRARIES}")
  31. include_directories(
  32. /usr/local/include
  33. ${PCL_INCLUDE_DIRS}
  34. ${OpenCV_INCLUDE_DIRS}
  35. ${PROTOBUF_INCLUDE_DIRS}
  36. ${CERES_INCLUDE_DIRS}
  37. ${rs_driver_INCLUDE_DIRS}
  38. communication
  39. message
  40. error_code
  41. tool
  42. system
  43. )
  44. link_directories("/usr/local/lib")
  45. message(STATUS ${EXECUTABLE_OUTPUT_PATH})
  46. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code ERROR_SRC )
  47. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message message_src )
  48. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/wanji_lidar WANJI_LIDAR_SRC )
  49. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/task TASK_MANAGER_SRC )
  50. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  51. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication COMMUNICATION_SRC )
  52. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system SYSTEM_SRC )
  53. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/verify VERIFY_SRC )
  54. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar/match3d/common VELODYNE_LIDAR_COMMON)
  55. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar/match3d/ VELODYNE_LIDAR_MATCH)
  56. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar/velodyne_driver VELODYNE_LIDAR_DRIVER)
  57. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar VELODYNE_LIDAR)
  58. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/rabbitmq RABBIT_MQ)
  59. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/rslidar RSLIDAR)
  60. add_executable(measure_wj
  61. main.cpp
  62. ${ERROR_SRC}
  63. ${message_src}
  64. ${WANJI_LIDAR_SRC}
  65. ${TASK_MANAGER_SRC}
  66. ${TOOL_SRC}
  67. ${COMMUNICATION_SRC}
  68. ${SYSTEM_SRC}
  69. ${VERIFY_SRC}
  70. ${VELODYNE_LIDAR_COMMON}
  71. ${VELODYNE_LIDAR_MATCH}
  72. ${VELODYNE_LIDAR_DRIVER}
  73. ${VELODYNE_LIDAR}
  74. ${RABBIT_MQ}
  75. ${RSLIDAR}
  76. )
  77. target_link_libraries(measure_wj
  78. /usr/local/lib/libglog.a
  79. /usr/local/lib/libgflags.a
  80. # /usr/lib/x86_64-linux-gnu/libglog.so
  81. # /usr/lib/x86_64-linux-gnu/libgflags.so
  82. /usr/local/lib/librabbitmq.a
  83. nnxx
  84. nanomsg
  85. ${PROTOBUF_LIBRARIES}
  86. ${OpenCV_LIBS}
  87. ${GLOG_LIBRARIES}
  88. ${PCL_LIBRARIES}
  89. ${CERES_LIBRARIES}
  90. ${YAML_CPP_LIBRARIES}
  91. ${rs_driver_LIBRARIES}
  92. -lpthread
  93. )
  94. # vlp16 driver test
  95. add_executable(vlp16 tests/vlp16_driver_test.cpp
  96. ${ERROR_SRC}
  97. ${message_src}
  98. ${WANJI_LIDAR_SRC}
  99. ${TASK_MANAGER_SRC}
  100. ${TOOL_SRC}
  101. ${COMMUNICATION_SRC}
  102. ${SYSTEM_SRC}
  103. ${RABBIT_MQ}
  104. ${VERIFY_SRC}
  105. ${VELODYNE_LIDAR_COMMON}
  106. ${VELODYNE_LIDAR_MATCH}
  107. ${VELODYNE_LIDAR_DRIVER}
  108. ${VELODYNE_LIDAR}
  109. ${RSLIDAR}
  110. )
  111. target_link_libraries(vlp16
  112. /usr/local/lib/libglog.a
  113. /usr/local/lib/libgflags.a
  114. # /usr/lib/x86_64-linux-gnu/libglog.so
  115. # /usr/lib/x86_64-linux-gnu/libgflags.so
  116. nnxx
  117. nanomsg
  118. ${PROTOBUF_LIBRARIES}
  119. ${OpenCV_LIBS}
  120. ${GLOG_LIBRARIES}
  121. ${PCL_LIBRARIES}
  122. ${CERES_LIBRARIES}
  123. ${YAML_CPP_LIBRARIES}
  124. ${rs_driver_LIBRARIES}
  125. /usr/local/lib/librabbitmq.a
  126. )
  127. # helios 16P driver test
  128. add_executable(rshelios16 tests/rslidar_test.cpp
  129. ${ERROR_SRC}
  130. ${message_src}
  131. ${WANJI_LIDAR_SRC}
  132. ${TASK_MANAGER_SRC}
  133. ${TOOL_SRC}
  134. ${COMMUNICATION_SRC}
  135. ${SYSTEM_SRC}
  136. ${RABBIT_MQ}
  137. ${VERIFY_SRC}
  138. ${VELODYNE_LIDAR_COMMON}
  139. ${VELODYNE_LIDAR_MATCH}
  140. ${VELODYNE_LIDAR_DRIVER}
  141. ${VELODYNE_LIDAR}
  142. ${RSLIDAR}
  143. )
  144. target_link_libraries(rshelios16
  145. /usr/local/lib/libglog.a
  146. /usr/local/lib/libgflags.a
  147. # /usr/lib/x86_64-linux-gnu/libglog.so
  148. # /usr/lib/x86_64-linux-gnu/libgflags.so
  149. nnxx
  150. nanomsg
  151. ${PROTOBUF_LIBRARIES}
  152. ${OpenCV_LIBS}
  153. ${GLOG_LIBRARIES}
  154. ${PCL_LIBRARIES}
  155. ${CERES_LIBRARIES}
  156. ${YAML_CPP_LIBRARIES}
  157. ${rs_driver_LIBRARIES}
  158. /usr/local/lib/librabbitmq.a
  159. )
  160. add_executable(lidar_calib_tool ./tests/lidar_calib_tools.cpp ./tool/point_tool.cpp)
  161. target_link_libraries(lidar_calib_tool
  162. ${PCL_LIBRARIES}
  163. ${OpenCV_LIBS}
  164. )