CMakeLists.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(wj_716_lidar)
  3. ## Compile as C++11, supported in ROS Kinetic and newer
  4. add_compile_options(-std=c++11)
  5. find_package(PCL REQUIRED)
  6. find_package(Boost REQUIRED)
  7. find_package(Eigen3 REQUIRED)
  8. find_package(Glog REQUIRED)
  9. find_package(GFlags REQUIRED)
  10. FIND_PACKAGE(Protobuf REQUIRED)
  11. ###################################
  12. ## catkin specific configuration ##
  13. ###################################
  14. ## The catkin_package macro generates cmake config files for your package
  15. ## Declare things to be passed to dependent projects
  16. ## INCLUDE_DIRS: uncomment this if your package contains header files
  17. ## LIBRARIES: libraries you create in this project that dependent projects also need
  18. ## CATKIN_DEPENDS: catkin_packages dependent projects also need
  19. ## DEPENDS: system dependencies of this project that dependent projects also need
  20. ###########
  21. ## Build ##
  22. ###########
  23. ## Specify additional locations of header files
  24. ## Your package locations should be listed before other locations
  25. include_directories(
  26. ${EIGEN3_INCLUDE_DIRS}
  27. ${Boost_INCLUDE_DIRS}
  28. ${PCL_INCLUDE_DIRS}
  29. /usr/local/include
  30. ./src
  31. )
  32. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/wj_lidar WJ_LIDAR_SRC)
  33. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/test WJ_TEST_SRC)
  34. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/error_code ERROR_CODE_SRC)
  35. add_executable(wj_716_lidar ${WJ_TEST_SRC} ${ERROR_CODE_SRC} ${WJ_LIDAR_SRC})
  36. target_link_libraries(wj_716_lidar ${PCL_LIBRARIES} ${Boost_LIBRARIES} ${PROTOBUF_LIBRARIES} glog gflags)
  37. #add_dependencies(wj_716_lidar ${PROJECT_NAME}_gencfg)
  38. ## Declare a C++ library
  39. # add_library(${PROJECT_NAME}
  40. # src/${PROJECT_NAME}/wj_716_lidar.cpp
  41. # )
  42. ## Add cmake target dependencies of the library
  43. ## as an example, code may need to be generated before libraries
  44. ## either from message generation or dynamic reconfigure
  45. # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
  46. ## Declare a C++ executable
  47. ## With catkin_make all packages are built within a single CMake context
  48. ## The recommended prefix ensures that target names across packages don't collide
  49. # add_executable(${PROJECT_NAME}_node src/wj_716_lidar_node.cpp)
  50. ## Rename C++ executable without prefix
  51. ## The above recommended prefix causes long target names, the following renames the
  52. ## target back to the shorter version for ease of user use
  53. ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
  54. # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
  55. ## Add cmake target dependencies of the executable
  56. ## same as for the library above
  57. # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
  58. ## Specify libraries to link a library or executable target against
  59. # target_link_libraries(${PROJECT_NAME}_node
  60. # ${catkin_LIBRARIES}
  61. # )
  62. #############
  63. ## Install ##
  64. #############
  65. # all install targets should use catkin DESTINATION variables
  66. # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
  67. ## Mark executable scripts (Python etc.) for installation
  68. ## in contrast to setup.py, you can choose the destination
  69. # install(PROGRAMS
  70. # scripts/my_python_script
  71. # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  72. # )
  73. ## Mark executables and/or libraries for installation
  74. # install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
  75. # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  76. # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  77. # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
  78. # )
  79. ## Mark cpp header files for installation
  80. # install(DIRECTORY include/${PROJECT_NAME}/
  81. # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  82. # FILES_MATCHING PATTERN "*.h"
  83. # PATTERN ".svn" EXCLUDE
  84. # )
  85. ## Mark other files for installation (e.g. launch and bag files, etc.)
  86. # install(FILES
  87. # # myfile1
  88. # # myfile2
  89. # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  90. # )
  91. #############
  92. ## Testing ##
  93. #############
  94. ## Add gtest based cpp test target and link libraries
  95. # catkin_add_gtest(${PROJECT_NAME}-test test/test_wj_716_lidar.cpp)
  96. # if(TARGET ${PROJECT_NAME}-test)
  97. # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
  98. # endif()
  99. ## Add folders to be run by python nosetests
  100. # catkin_add_nosetests(test)