代码拉取完成,页面将自动刷新
同步操作将从 duyongquan/slam_tutorial 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
cmake_minimum_required(VERSION 3.2)
project(slam)
set(CMAKE_CXX_STANDARD 14)
# set version
set(SLAM_MAJOR_VERSION 0)
set(SLAM_MINOR_VERSION 0)
set(SLAM_PATCH_VERSION 1)
set(SLAM_VERSION ${SLAM_MAJOR_VERSION}.${SLAM_MINOR_VERSION}.${SLAM_PATCH_VERSION})
set(SLAM_SOVERSION ${SLAM_MAJOR_VERSION}.${SLAM_MINOR_VERSION})
# lib bin
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
option(BUILD_TEST "Project build test" ON)
include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake")
project_initialize()
project_enable_testing()
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Threads REQUIRED)
find_package(Ceres REQUIRED)
file(GLOB_RECURSE ALL_LIBRARY_HDRS "slam/*.h")
file(GLOB_RECURSE ALL_LIBRARY_SRCS "slam/*.cpp")
file(GLOB_RECURSE ALL_TESTS "slam/*_test.cpp")
file(GLOB_RECURSE ALL_EXECUTABLES "slam/*_main.cpp")
list(REMOVE_ITEM ALL_LIBRARY_SRCS ${ALL_EXECUTABLES})
list(REMOVE_ITEM ALL_LIBRARY_SRCS ${ALL_TESTS})
if (WIN32)
find_package(glog REQUIRED)
set(GLOG_LIBRARY glog::glog)
else()
set(GLOG_LIBRARY glog)
endif()
add_library(${PROJECT_NAME} STATIC ${ALL_LIBRARY_HDRS} ${ALL_LIBRARY_SRCS} ${ALL_LIBRARY_HPPS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${OpenCV_LIBS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${GLOG_LIBRARY})
target_link_libraries(${PROJECT_NAME} PUBLIC ${CERES_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${PROJECT_NAME} PUBLIC rt)
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${EIGEN3_INCLUDE_DIR}")
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${OpenCV_INCLUDE_DIRS}")
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC "${CERES_INCLUDE_DIRS}")
if (BUILD_TEST)
foreach(ABS_FIL ${ALL_TESTS})
file(RELATIVE_PATH REL_FIL ${PROJECT_SOURCE_DIR} ${ABS_FIL})
get_filename_component(DIR ${REL_FIL} DIRECTORY)
get_filename_component(FIL_WE ${REL_FIL} NAME_WE)
string(REPLACE "/" "." TEST_TARGET_NAME "${DIR}/${FIL_WE}")
project_test("${TEST_TARGET_NAME}" ${ABS_FIL})
target_include_directories(${TEST_TARGET_NAME} SYSTEM PRIVATE "${GMOCK_INCLUDE_DIRS}")
target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${GTEST_LIBRARIES})
endforeach()
endif()
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
project_binary(slam_main
SRCS
slam/slam_main.cpp
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。