CMakeLists.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. parkspace_allocation
  24. /usr/local/include/cppconn/
  25. )
  26. link_directories("/usr/local/lib")
  27. message(STATUS ${EXECUTABLE_OUTPUT_PATH})
  28. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code error_src )
  29. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message message_src )
  30. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/lidar_locate locate_src )
  31. #aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/robot robot_src )
  32. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/laser LASER_SRC )
  33. #aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/plc PLC_SRC )
  34. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/locate LOCATE_SRC )
  35. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/terminor TERMINOR_SRC )
  36. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/task TASK_MANAGER_SRC )
  37. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  38. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication COMMUNICATION_SRC )
  39. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system SYSTEM_SRC )
  40. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/parkspace_allocation PARKSPACE_ALLOC_SRC )
  41. # 车位分配测试
  42. add_executable(parkspace_test
  43. ./test/test_parkspace_sample.cpp
  44. ${error_src}
  45. ${message_src}
  46. ${TOOL_SRC}
  47. ${COMMUNICATION_SRC}
  48. ${PARKSPACE_ALLOC_SRC}
  49. )
  50. target_link_libraries(parkspace_test
  51. nnxx
  52. nanomsg
  53. ${PROTOBUF_LIBRARIES}
  54. /usr/local/lib/libglog.a
  55. /usr/local/lib/libgflags.a
  56. libmysqlcppconn.so
  57. )
  58. add_executable(parkspace_client
  59. ./test/parkspace_client.cpp
  60. ${error_src}
  61. ${message_src}
  62. ${TOOL_SRC}
  63. ${COMMUNICATION_SRC}
  64. )
  65. target_link_libraries(parkspace_client
  66. nnxx
  67. nanomsg
  68. ${PROTOBUF_LIBRARIES}
  69. /usr/local/lib/libglog.a
  70. /usr/local/lib/libgflags.a
  71. )
  72. # db test
  73. add_executable(db_test
  74. ./test/db_test.cpp
  75. ./parkspace_allocation/database_controller.cpp
  76. ${error_src}
  77. ${TOOL_SRC}
  78. )
  79. target_link_libraries(db_test
  80. ${PROTOBUF_LIBRARIES}
  81. /usr/local/lib/libglog.a
  82. /usr/local/lib/libgflags.a
  83. libmysqlcppconn.so pthread
  84. )