1 Star 0 Fork 4

huangwen0907/slam_tutorial

forked from duyongquan/slam_tutorial 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 2.58 KB
一键复制 编辑 原始数据 按行查看 历史
duyongquan 提交于 2021-12-06 19:27 . slam tutorial first verson
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
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huangwen0907/slam_tutorial.git
git@gitee.com:huangwen0907/slam_tutorial.git
huangwen0907
slam_tutorial
slam_tutorial
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385