CMakeLists.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. project(nnxx_tests)
  2. cmake_minimum_required(VERSION 3.5)
  3. set (CMAKE_CXX_STANDARD 11)
  4. find_package(PkgConfig REQUIRED)
  5. pkg_check_modules(nanomsg REQUIRED nanomsg)
  6. FIND_PACKAGE(Protobuf REQUIRED)
  7. FIND_PACKAGE(Glog REQUIRED)
  8. FIND_PACKAGE(OpenCV REQUIRED)
  9. FIND_PACKAGE(PCL REQUIRED)
  10. include_directories(
  11. /usr/local/include
  12. ${PROTOBUF_INCLUDE_DIRS}
  13. ./message
  14. ./communication
  15. ./error_code
  16. ./tool
  17. ./system
  18. # ${PCL_INCLUDE_DIRS}
  19. # ${OpenCV_INCLUDE_DIRS}
  20. # ./laser
  21. # ./locate
  22. )
  23. link_directories("/usr/local/lib")
  24. message(STATUS ${EXECUTABLE_OUTPUT_PATH})
  25. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code error_src )
  26. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message message_src )
  27. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/lidar_locate locate_src )
  28. #aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/robot robot_src )
  29. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/laser LASER_SRC )
  30. #aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/plc PLC_SRC )
  31. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/locate LOCATE_SRC )
  32. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/terminor TERMINOR_SRC )
  33. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/task TASK_MANAGER_SRC )
  34. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  35. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication COMMUNICATION_SRC )
  36. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system SYSTEM_SRC )
  37. add_executable(terminal
  38. main.cpp
  39. ${error_src}
  40. ${locate_src}
  41. ${robot_src}
  42. ${message_src}
  43. ${LASER_SRC}
  44. ${PLC_SRC}
  45. ${TERMINOR_SRC}
  46. ${LOCATE_SRC}
  47. ${TASK_MANAGER_SRC}
  48. ${TOOL_SRC}
  49. ${COMMUNICATION_SRC}
  50. ${SYSTEM_SRC}
  51. )
  52. target_link_libraries(terminal
  53. /usr/local/lib/libglog.a
  54. /usr/local/lib/libgflags.a
  55. /usr/local/lib/liblivox_sdk_static.a
  56. /usr/local/apr/lib/libapr-1.a
  57. nnxx
  58. nanomsg
  59. ${PROTOBUF_LIBRARIES}
  60. ${OpenCV_LIBS}
  61. ${GLOG_LIBRARIES}
  62. ${PCL_LIBRARIES}
  63. )
  64. add_executable(locate_client
  65. ./test/Locate_client.cpp
  66. ./lidar_locate/Locate_communicator.cpp
  67. ./error_code/error_code.cpp
  68. ${message_src}
  69. ${TOOL_SRC}
  70. ${COMMUNICATION_SRC}
  71. )
  72. target_link_libraries(locate_client
  73. nnxx
  74. nanomsg
  75. ${PROTOBUF_LIBRARIES}
  76. /usr/local/lib/libglog.a
  77. /usr/local/lib/libgflags.a
  78. libtensorflow_cc.so
  79. #tf_3dcnn_api.so
  80. pointSIFT_API.so
  81. -lpthread
  82. )
  83. add_executable(locate_test
  84. ./test/test_locate_sample.cpp
  85. ./lidar_locate/Locate_communicator.cpp
  86. ./error_code/error_code.cpp
  87. ${message_src}
  88. ${TOOL_SRC}
  89. ${COMMUNICATION_SRC}
  90. )
  91. target_link_libraries(locate_test
  92. nnxx
  93. nanomsg
  94. ${PROTOBUF_LIBRARIES}
  95. /usr/local/lib/libglog.a
  96. /usr/local/lib/libgflags.a
  97. )
  98. # 车位分配测试
  99. add_executable(parkspace_test
  100. ./test/test_parkspace_sample.cpp
  101. ./parkspace_allocation/parkspace_allocation_communicator.cpp
  102. ./error_code/error_code.cpp
  103. ${message_src}
  104. ${TOOL_SRC}
  105. ${COMMUNICATION_SRC}
  106. )
  107. target_link_libraries(parkspace_test
  108. nnxx
  109. nanomsg
  110. ${PROTOBUF_LIBRARIES}
  111. /usr/local/lib/libglog.a
  112. /usr/local/lib/libgflags.a
  113. )
  114. add_executable(parkspace_client
  115. ./test/parkspace_client.cpp
  116. ./error_code/error_code.cpp
  117. ${message_src}
  118. ${TOOL_SRC}
  119. ${COMMUNICATION_SRC}
  120. )
  121. target_link_libraries(parkspace_client
  122. nnxx
  123. nanomsg
  124. ${PROTOBUF_LIBRARIES}
  125. /usr/local/lib/libglog.a
  126. /usr/local/lib/libgflags.a
  127. )