CMakeLists.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright(c) 2019 livoxtech limited.
  2. cmake_minimum_required(VERSION 2.8.3)
  3. #---------------------------------------------------------------------------------------
  4. # Start livox_ros_driver project
  5. #---------------------------------------------------------------------------------------
  6. project(NavUI)
  7. #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
  8. SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
  9. #---------------------------------------------------------------------------------------
  10. # find package and the dependecy
  11. #---------------------------------------------------------------------------------------
  12. find_package(Boost 1.54 REQUIRED COMPONENTS
  13. system
  14. thread
  15. chrono
  16. )
  17. find_package (Eigen3 REQUIRED CONFIG QUIET)
  18. find_package(Pangolin 0.8 REQUIRED)
  19. find_package(PCL REQUIRED)
  20. FIND_PACKAGE(Protobuf REQUIRED)
  21. FIND_PACKAGE(Glog REQUIRED)
  22. #---------------------------------------------------------------------------------------
  23. # Set default build to release
  24. #---------------------------------------------------------------------------------------
  25. if(NOT CMAKE_BUILD_TYPE)
  26. set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
  27. endif()
  28. #---------------------------------------------------------------------------------------
  29. # Compiler config
  30. #---------------------------------------------------------------------------------------
  31. set(CMAKE_CXX_STANDARD 14)
  32. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  33. set(CMAKE_CXX_EXTENSIONS OFF)
  34. include_directories(
  35. define
  36. /usr/local/include
  37. ${Pangolin_INCLUDE_DIRS}
  38. ${EIGEN3_INCLUDE_DIR}
  39. ${PCL_INCLUDE_DIRS}
  40. )
  41. link_directories("/usr/local/lib")
  42. ## PCL library
  43. link_directories(${PCL_LIBRARY_DIRS})
  44. add_definitions(${PCL_DEFINITIONS})
  45. #---------------------------------------------------------------------------------------
  46. # generate excutable and add libraries
  47. #---------------------------------------------------------------------------------------
  48. add_executable(${PROJECT_NAME}
  49. main.cpp
  50. map.pb.cc
  51. define/TimerRecord.cpp
  52. pangolinViewer.cpp
  53. dijkstra/dijkstra.cpp
  54. dijkstra/trajectory.cpp
  55. dijkstra/pose2d.cpp
  56. emqx/mqttmsg.cpp
  57. emqx/paho_client.cpp
  58. emqx/message.pb.cc
  59. tool/pathcreator.cpp
  60. tool/proto_tool.cpp
  61. emqx/terminator_emqx.cpp
  62. emqx/agv.cpp)
  63. target_compile_options(${PROJECT_NAME}
  64. PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall>
  65. )
  66. #---------------------------------------------------------------------------------------
  67. # link libraries
  68. #---------------------------------------------------------------------------------------
  69. target_link_libraries(${PROJECT_NAME}
  70. pango_display
  71. ${PCL_LIBRARIES}
  72. ${Boost_LIBRARY}
  73. ${GLOG_LIBRARIES} ${PROTOBUF_LIBRARIES}
  74. libglog.a libgflags.a
  75. paho-mqtt3a
  76. -lpthread
  77. ipopt
  78. )
  79. #---------------------------------------------------------------------------------------
  80. # precompile macro and compile option
  81. #---------------------------------------------------------------------------------------