CMakeLists.txt 2.4 KB

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