CMakeLists.txt 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # 添加文件
  2. aux_source_directory(error_code error_code)
  3. aux_source_directory(json json)
  4. aux_source_directory(message message)
  5. aux_source_directory(pahoc pahoc)
  6. aux_source_directory(tool tool)
  7. aux_source_directory(rabbitmq rabbitmq)
  8. # 生成静态库
  9. add_library(zx
  10. ${error_code}
  11. ${json}
  12. ${message}
  13. ${pahoc}
  14. ${tool}
  15. ${rabbitmq}
  16. )
  17. if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
  18. set(Rabbitmq
  19. /usr/lib/aarch64-linux-gnu/librabbitmq.a
  20. )
  21. else()
  22. set(Rabbitmq
  23. /usr/local/lib/librabbitmq.a
  24. )
  25. endif()
  26. # 添加链接静态库
  27. target_link_libraries(zx PUBLIC
  28. ${EIGEN3_LIBRARIES}
  29. ${OpenCV_LIBRARIES}
  30. ${PROTOBUF_LIBRARIES}
  31. ${PCL_LIBRARIES}
  32. ${Rabbitmq}
  33. paho-mqtt3a
  34. -lgflags
  35. glog::glog
  36. )
  37. # 安装库到安装路径
  38. INSTALL (TARGETS zx
  39. DESTINATION lib
  40. )