CMakeLists.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. set(PCL_DIR "/home/youchen/pcl-1.8/share/pcl-1.8")
  7. FIND_PACKAGE(OpenCV REQUIRED)
  8. FIND_PACKAGE(PCL REQUIRED)
  9. FIND_PACKAGE(Protobuf REQUIRED)
  10. FIND_PACKAGE(Glog REQUIRED)
  11. FIND_PACKAGE(Ceres REQUIRED)
  12. set(CMAKE_MODULE_PATH "/usr/local/share/")
  13. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed")
  14. set(CMAKE_CXX_FLAGS "-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")
  15. set(CMAKE_BUILD_TYPE "RELEASE")
  16. #find_package(Eigen3 REQUIRED)
  17. include_directories(
  18. laser
  19. plc
  20. src
  21. Locate
  22. /usr/local/include
  23. /usr/local/include/modbus
  24. /usr/local/include/snap7
  25. ${PCL_INCLUDE_DIRS}
  26. ${OpenCV_INCLUDE_DIRS}
  27. ${CERES_INCLUDE_DIRS}
  28. )
  29. link_directories("/usr/local/lib")
  30. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/task TASK_MANAGER_SRC )
  31. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/error_code ERROR_SRC )
  32. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/tool TOOL_SRC )
  33. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/laser LASER_SRC )
  34. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/plc PLC_SRC )
  35. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/locate LOCATE_SRC )
  36. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/terminor TERMINOR_SRC )
  37. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/verify VERIFY_SRC )
  38. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/system_manager SYS_SRC )
  39. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/wj_lidar WJLIDAR_SRC )
  40. # locate sample
  41. add_executable(wj_sample ./test/wj_lidar_test.cpp ${ERROR_SRC} ${TOOL_SRC} ${TASK_MANAGER_SRC} ${WJLIDAR_SRC} ${VERIFY_SRC})
  42. target_link_libraries(wj_sample ${OpenCV_LIBS} ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES} ${CERES_LIBRARIES}
  43. /usr/local/lib/libglog.a /usr/local/lib/libgflags.a nnxx nanomsg snap7)
  44. # add_executable(locate_sample test/locate_sample.cpp ${LOCATE_SRC} ${TASK_MANAGER_SRC} ${ERROR_SRC}
  45. # ${TOOL_SRC})
  46. # target_link_libraries(locate_sample ${OpenCV_LIBS}
  47. # ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES} libtensorflow_cc.so
  48. # tf_3dcnn_api.so pointSIFT_API.so dark.so /usr/local/lib/libglog.a
  49. # /usr/local/lib/libgflags.a snap7 nnxx nanomsg)
  50. # add_executable(fence_debug test/plc_s7.cpp wj_lidar/wj_lidar_msg.pb.cc)
  51. # target_link_libraries(fence_debug ${GLOG_LIBRARIES} ${PROTOBUF_LIBRARIES} /usr/local/lib/libglog.a
  52. # /usr/local/lib/libgflags.a nnxx nanomsg)
  53. # add_executable(locate main.cpp ${LOCATE_SRC} ${PLC_SRC} ${TERMINOR_SRC} ${TASK_MANAGER_SRC} ${LASER_SRC} ${ERROR_SRC}
  54. # ${TOOL_SRC} ${SYS_SRC} ${VERIFY_SRC} ${WJLIDAR_SRC})
  55. # target_link_libraries(locate ${OpenCV_LIBS} ${CERES_LIBRARIES}
  56. # ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES} ipopt libtensorflow_cc.so
  57. # tf_3dcnn_api.so pointSIFT_API.so dark.so /usr/local/lib/libmodbus.so /usr/local/lib/libglog.a
  58. # /usr/local/lib/libgflags.a /usr/local/lib/liblivox_sdk_static.a /usr/local/apr/lib/libapr-1.a snap7 nnxx nanomsg)