CMakeLists.txt 3.9 KB

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