CMakeLists.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. ${OpenCV_INCLUDE_DIRS}
  14. ${PROTOBUF_INCLUDE_DIRS}
  15. communication
  16. message
  17. error_code
  18. tool
  19. parkspace_allocation
  20. /usr/local/include/cppconn/
  21. )
  22. link_directories("/usr/local/lib")
  23. message(STATUS ${EXECUTABLE_OUTPUT_PATH})
  24. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code error_src )
  25. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/message message_src )
  26. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  27. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/communication COMMUNICATION_SRC )
  28. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/parkspace_allocation PARKSPACE_ALLOC_SRC )
  29. # 车位分配测试
  30. add_executable(parkspace_test
  31. ./test/test_parkspace_sample.cpp
  32. ${error_src}
  33. ${message_src}
  34. ${TOOL_SRC}
  35. ${COMMUNICATION_SRC}
  36. ${PARKSPACE_ALLOC_SRC}
  37. )
  38. target_link_libraries(parkspace_test
  39. nnxx
  40. nanomsg
  41. nng
  42. ${PROTOBUF_LIBRARIES}
  43. ${PCL_LIBRARIES}
  44. /usr/local/lib/libglog.a
  45. /usr/local/lib/libgflags.a
  46. libmysqlcppconn.so
  47. -lpthread
  48. )
  49. #add_executable(parkspace_client
  50. # ./test/parkspace_client.cpp
  51. # ${error_src}
  52. # ${message_src}
  53. # ${TOOL_SRC}
  54. # ${COMMUNICATION_SRC}
  55. # )
  56. #target_link_libraries(parkspace_client
  57. # nnxx
  58. # nanomsg
  59. # ${PROTOBUF_LIBRARIES}
  60. # ${PCL_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. # )
  71. #target_link_libraries(db_test
  72. # ${PROTOBUF_LIBRARIES}
  73. # /usr/local/lib/libglog.a
  74. # /usr/local/lib/libgflags.a
  75. # libmysqlcppconn.so pthread
  76. # )