123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- # Copyright(c) 2019 livoxtech limited.
- cmake_minimum_required(VERSION 2.8.3)
- #---------------------------------------------------------------------------------------
- # Start livox_ros_driver project
- #---------------------------------------------------------------------------------------
- project(lio_livox_cpp)
- #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
- SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
- #---------------------------------------------------------------------------------------
- # find package and the dependecy
- #---------------------------------------------------------------------------------------
- find_package(Boost 1.54 REQUIRED COMPONENTS
- system
- thread
- chrono
- )
- find_package (Eigen3 REQUIRED CONFIG QUIET)
- find_package(Pangolin 0.8 REQUIRED)
- find_package(PCL REQUIRED)
- find_package(Ceres REQUIRED)
- find_package(OpenCV REQUIRED)
- find_package(SuiteSparse REQUIRED)
- find_package(PkgConfig)
- pkg_check_modules(APR apr-1)
- if (APR_FOUND)
- message(${APR_INCLUDE_DIRS})
- message(${APR_LIBRARIES})
- endif (APR_FOUND)
- #---------------------------------------------------------------------------------------
- # Set default build to release
- #---------------------------------------------------------------------------------------
- if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
- endif()
- #---------------------------------------------------------------------------------------
- # Compiler config
- #---------------------------------------------------------------------------------------
- set(CMAKE_CXX_STANDARD 17)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
- set(CMAKE_CXX_EXTENSIONS OFF)
- ## make sure the livox_sdk_static library is installed
- find_library(LIVOX_SDK_LIBRARY liblivox_sdk_static.a /usr/local/lib)
- include_directories(
- define
- lio/include
- lio/src
- ${Pangolin_INCLUDE_DIRS}
- ${EIGEN3_INCLUDE_DIR}
- ${PCL_INCLUDE_DIRS}
- ${CERES_INCLUDE_DIRS}
- ${OpenCV_INCLUDE_DIRS}
- ${SUITESPARSE_INCLUDE_DIRS}
- ${APR_INCLUDE_DIRS}
- livox/common
- livox/common/rapidjson
- livox/comon/rapdidxml
- livox/common/comm
- livox/timesync
- livox/timesync/user_uart
- livox/livox_driver)
- ## PCL library
- link_directories(${PCL_LIBRARY_DIRS})
- add_definitions(${PCL_DEFINITIONS})
- #---------------------------------------------------------------------------------------
- # generate excutable and add libraries
- #---------------------------------------------------------------------------------------
- add_executable(${PROJECT_NAME}_node
- main.cpp
- lio/src/segment/LidarFeatureExtractor.cpp
- lio/src/segment/segment.cpp
- lio/src/segment/pointsCorrect.cpp
- lio/src/lio/LocalMapIvox.cpp
- lio/src/lio/mapper.cpp
- lio/src/lio/Estimator.cpp
- lio/src/lio/IMUIntegrator.cpp
- lio/src/lio/ceresfunc.cpp
- lio/src/lio/ndtMap.cpp
- lio/src/utils/TimerRecord.cpp
- livox/livox_driver/lvx_file.cpp
- livox/livox_driver/ldq.cpp
- livox/livox_driver/lds.cpp
- livox/livox_driver/lds_lvx.cpp
- livox/livox_driver/lds_lidar.cpp
- livox/livox_driver/lds_hub.cpp
- livox/livox_driver/lddc.cpp
- livox/timesync/timesync.cpp
- livox/timesync/user_uart/user_uart.cpp
- livox/common/comm/comm_protocol.cpp
- livox/common/comm/sdk_protocol.cpp
- livox/common/comm/gps_protocol.cpp
- pangolinViewer.cpp
- )
- #---------------------------------------------------------------------------------------
- # precompile macro and compile option
- #---------------------------------------------------------------------------------------
- target_compile_options(${PROJECT_NAME}_node
- PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall>
- )
- #---------------------------------------------------------------------------------------
- # link libraries
- #---------------------------------------------------------------------------------------
- target_link_libraries(${PROJECT_NAME}_node
- pango_display
- livox_sdk_static.a
- ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${CERES_LIBRARIES}
- ${Boost_LIBRARY}
- ${APR_LIBRARIES}
- -lpthread
- ipopt
- )
- #---------------------------------------------------------------------------------------
- # end of CMakeList.txt
- #---------------------------------------------------------------------------------------
|