CMakeLists.txt 1.5 KB
Newer Older
wangdawei's avatar
wangdawei committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
cmake_minimum_required(VERSION 2.8)

project(PCloudLocalize)

set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_BUILD_TYPE "Debug")

add_compile_options(-fPIC)
set(CMAKE_CXX_STANDARD 17)
option(ENABLE_FAST_GICP "Use fast gicp lib" OFF)
option(ENABLE_ESKF "Use eskf" ON)
option(ENABLE_BAG "Use ros bag" OFF)
option(ENABLE_ROS "Use ros lib" ON)
option(ONE_MESH "Use stream of ONE big mesh" ON)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
message("----------------------")
if (ENABLE_FAST_GICP)
    message("Use fast gicp lib: ON")
    add_definitions(-DENABLE_FAST_GICP)
else()
    message("Use fast gicp lib: OFF")
endif()

if (ENABLE_ESKF)
    message("Use eskf: ON")
    add_definitions(-DENABLE_ESKF)
else()
    message("Use eskf: OFF")
endif()

if (ENABLE_ROS)
    message("Use ros lib: ON")
    add_definitions(-DENABLE_ROS)
else()
    message("Use ros lib: OFF")
endif()

if (ENABLE_BAG)
    message("Use ros bag: ON")
    add_definitions(-DENABLE_BAG)
else()
    message("Use ros bag: OFF")
endif()

if (ONE_MESH)
    message("Use stream of ONE big mesh: ON")
    add_definitions(-DONE_MESH)
else()
    message("Use stream of ONE big mesh: OFF")
endif()
message("----------------------")

option(TEST_ESKF "test eskf" OFF)
if (TEST_ESKF)
    add_definitions(-DTEST_ESKF)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Glog REQUIRED)
find_package(GFlags REQUIRED)

set(HOME_DIR ${CMAKE_CURRENT_SOURCE_DIR})

#有依赖的在前 被依赖的在后
add_subdirectory(apps)
add_subdirectory(libs)