CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. cmake_minimum_required(VERSION 3.0.2)
  2. project(test)
  3. ## Compile as C++11, supported in ROS Kinetic and newer
  4. add_compile_options(-std=c++14)
  5. FIND_PACKAGE(Protobuf REQUIRED)
  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. std_msgs
  12. )
  13. find_package(PCL REQUIRED)
  14. set(vtk_flags)
  15. foreach(it ${dir_defs})
  16. if(it MATCHES "vtk*")
  17. list(APPEND vtk_flags ${it})
  18. endif()
  19. endforeach()
  20. foreach(d ${vtk_flags})
  21. remove_definitions(-D${d})
  22. endforeach()
  23. catkin_package(
  24. # INCLUDE_DIRS include
  25. # LIBRARIES pkgname
  26. # CATKIN_DEPENDS roscpp std_msgs
  27. # DEPENDS system_lib
  28. )
  29. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/Processing_Message PROCESSING_MESSAGE_SRC )
  30. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message MESSAGE_SRC )
  31. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  32. include_directories(
  33. /usr/local/include
  34. ${catkin_INCLUDE_DIRS}
  35. ${PCL_INCLUDE_DIRS}
  36. ${PROTOBUF_INCLUDE_DIRS}
  37. message
  38. tool
  39. Processing_Message
  40. )
  41. add_executable(test_node
  42. ./src/main.cpp
  43. ${PROCESSING_MESSAGE_SRC}
  44. ${TOOL_SRC}
  45. ${MESSAGE_SRC}
  46. )
  47. target_link_libraries(test_node
  48. /usr/local/lib/libglog.a
  49. /usr/local/lib/libgflags.a
  50. ${catkin_LIBRARIES}
  51. ${PCL_LIBRARIES}
  52. ${PROTOBUF_LIBRARIES}
  53. nnxx
  54. nanomsg
  55. pthread
  56. )