CMakeLists.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(VLP16_measure)
  3. ## Compile as C++11, supported in ROS Kinetic and newer
  4. add_compile_options(-std=c++14)
  5. #add_definitions(-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2)
  6. FIND_PACKAGE(PCL REQUIRED)
  7. FIND_PACKAGE(Protobuf REQUIRED)
  8. find_package(OpenCV 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. include_directories(
  16. src
  17. src/message
  18. src/tool
  19. src/error_code
  20. src/communication
  21. /usr/local/include
  22. /usr/local/include/modbus
  23. /usr/local/include/snap7
  24. ${OpenCV_INCLUDE_DIRS}
  25. ${PCL_INCLUDE_DIRS}
  26. ${CERES_INCLUDE_DIRS}
  27. )
  28. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/tool TOOL_SRC )
  29. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/error_code ERROR_SRC )
  30. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/communication COMMUNICATION_SRC )
  31. aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/message MESSAGE_SRC )
  32. add_executable(vlp16_sample src/vlp16_sample.cpp ${ERROR_SRC} ${TOOL_SRC}
  33. ${COMMUNICATION_SRC} ${MESSAGE_SRC}
  34. src/vlp16.hpp src/ground_region.cpp src/publisher.cpp
  35. src/configure.pb.cc src/detect_wheel_ceres.cpp)
  36. target_link_libraries(vlp16_sample ${CERES_LIBRARIES} ${OpenCV_LIBS}
  37. ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES}
  38. /usr/local/lib/libgflags.a nnxx nanomsg)