CMakeLists.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(LidarMeasure)
  3. ## Compile as C++11, supported in ROS Kinetic and newer
  4. add_compile_options(-std=c++11)
  5. #add_definitions(-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2)
  6. FIND_PACKAGE(OpenCV REQUIRED)
  7. FIND_PACKAGE(PCL REQUIRED)
  8. FIND_PACKAGE(Protobuf REQUIRED)
  9. FIND_PACKAGE(Glog REQUIRED)
  10. FIND_PACKAGE(Ceres REQUIRED)
  11. set(CMAKE_MODULE_PATH "/usr/local/share/")
  12. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed")
  13. set(CMAKE_CXX_FLAGS "-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")
  14. set(CMAKE_BUILD_TYPE "RELEASE")
  15. #find_package(Eigen3 REQUIRED)
  16. include_directories(
  17. laser
  18. plc
  19. src
  20. Locate
  21. /usr/local/include
  22. /usr/local/include/modbus
  23. /usr/local/include/snap7
  24. ${PCL_INCLUDE_DIRS}
  25. ${OpenCV_INCLUDE_DIRS}
  26. ${CERES_INCLUDE_DIRS}
  27. )
  28. link_directories("/usr/local/lib")
  29. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/task TASK_MANAGER_SRC )
  30. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code ERROR_SRC )
  31. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_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}/verify VERIFY_SRC )
  37. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system_manager SYS_SRC )
  38. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/wj_lidar WJLIDAR_SRC )
  39. add_executable(locate_sample test/locate_sample.cpp ${LOCATE_SRC} ${TASK_MANAGER_SRC} ${ERROR_SRC}
  40. ${TOOL_SRC})
  41. target_link_libraries(locate_sample ${OpenCV_LIBS}
  42. ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES} libtensorflow_cc.so
  43. tf_3dcnn_api.so pointSIFT_API.so dark.so /usr/local/lib/libglog.a
  44. /usr/local/lib/libgflags.a snap7 nnxx nanomsg)
  45. add_executable(fence_debug test/plc_s7.cpp wj_lidar/wj_lidar_msg.pb.cc)
  46. target_link_libraries(fence_debug ${GLOG_LIBRARIES} ${PROTOBUF_LIBRARIES} /usr/local/lib/libglog.a
  47. /usr/local/lib/libgflags.a nnxx nanomsg)
  48. add_executable(locate main.cpp ${LOCATE_SRC} ${PLC_SRC} ${TERMINOR_SRC} ${TASK_MANAGER_SRC} ${LASER_SRC} ${ERROR_SRC}
  49. ${TOOL_SRC} ${SYS_SRC} ${VERIFY_SRC} ${WJLIDAR_SRC})
  50. target_link_libraries(locate ${OpenCV_LIBS} ${CERES_LIBRARIES}
  51. ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES} ipopt libtensorflow_cc.so
  52. tf_3dcnn_api.so pointSIFT_API.so dark.so /usr/local/lib/libmodbus.so /usr/local/lib/libglog.a
  53. /usr/local/lib/libgflags.a /usr/local/lib/liblivox_sdk_static.a /usr/local/apr/lib/libapr-1.a snap7 nnxx nanomsg)