CMakeLists.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. project(measure_wj_proj)
  2. cmake_minimum_required(VERSION 3.5)
  3. set (CMAKE_CXX_STANDARD 11)
  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. MESSAGE(WARN "pcl:: ${PCL_INCLUDE_DIRS} --- ${PCL_LIBRARIES}")
  29. include_directories(
  30. /usr/local/include
  31. ${PCL_INCLUDE_DIRS}
  32. ${OpenCV_INCLUDE_DIRS}
  33. ${PROTOBUF_INCLUDE_DIRS}
  34. ${CERES_INCLUDE_DIRS}
  35. communication
  36. message
  37. error_code
  38. tool
  39. system
  40. )
  41. link_directories("/usr/local/lib")
  42. message(STATUS ${EXECUTABLE_OUTPUT_PATH})
  43. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code ERROR_SRC )
  44. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message message_src )
  45. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/wanji_lidar WANJI_LIDAR_SRC )
  46. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/task TASK_MANAGER_SRC )
  47. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  48. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication COMMUNICATION_SRC )
  49. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system SYSTEM_SRC )
  50. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/verify VERIFY_SRC )
  51. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar/match3d/common VELODYNE_LIDAR_COMMON)
  52. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar/match3d/ VELODYNE_LIDAR_MATCH)
  53. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar/velodyne_driver VELODYNE_LIDAR_DRIVER)
  54. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/velodyne_lidar VELODYNE_LIDAR)
  55. add_executable(measure_wj
  56. main.cpp
  57. ${ERROR_SRC}
  58. ${message_src}
  59. ${WANJI_LIDAR_SRC}
  60. ${TASK_MANAGER_SRC}
  61. ${TOOL_SRC}
  62. ${COMMUNICATION_SRC}
  63. ${SYSTEM_SRC}
  64. ${VERIFY_SRC}
  65. ${VELODYNE_LIDAR_COMMON}
  66. ${VELODYNE_LIDAR_MATCH}
  67. ${VELODYNE_LIDAR_DRIVER}
  68. ${VELODYNE_LIDAR}
  69. )
  70. target_link_libraries(measure_wj
  71. /usr/local/lib/libglog.a
  72. /usr/local/lib/libgflags.a
  73. nnxx
  74. nanomsg
  75. ${PROTOBUF_LIBRARIES}
  76. ${OpenCV_LIBS}
  77. ${GLOG_LIBRARIES}
  78. ${PCL_LIBRARIES}
  79. ${CERES_LIBRARIES}
  80. ${YAML_CPP_LIBRARIES}
  81. -lpthread
  82. )
  83. # vlp16 driver test
  84. add_executable(vlp16 tests/vlp16_driver_test.cpp
  85. ${ERROR_SRC}
  86. ${message_src}
  87. ${WANJI_LIDAR_SRC}
  88. ${TASK_MANAGER_SRC}
  89. ${TOOL_SRC}
  90. ${COMMUNICATION_SRC}
  91. ${SYSTEM_SRC}
  92. ${VERIFY_SRC}
  93. ${VELODYNE_LIDAR_COMMON}
  94. ${VELODYNE_LIDAR_MATCH}
  95. ${VELODYNE_LIDAR_DRIVER}
  96. ${VELODYNE_LIDAR}
  97. )
  98. target_link_libraries(vlp16
  99. /usr/local/lib/libglog.a
  100. /usr/local/lib/libgflags.a
  101. nnxx
  102. nanomsg
  103. ${PROTOBUF_LIBRARIES}
  104. ${OpenCV_LIBS}
  105. ${GLOG_LIBRARIES}
  106. ${PCL_LIBRARIES}
  107. ${CERES_LIBRARIES}
  108. ${YAML_CPP_LIBRARIES}
  109. )
  110. add_executable(lidar_calib_tool ./tests/lidar_calib_tools.cpp ./tool/point_tool.cpp)
  111. target_link_libraries(lidar_calib_tool
  112. ${PCL_LIBRARIES}
  113. ${OpenCV_LIBS}
  114. )