当前位置:网站首页>ORBSLAM2 CmakeLists文件结构解析
ORBSLAM2 CmakeLists文件结构解析
2022-07-26 11:00:00 【AutoGalaxy】
(一)引用库
1 自定义库
统一使用如下的语句包含
add_library(${PROJECT_NAME} SHARED
src/System.cc
src/Tracking.cc
src/LocalMapping.cc
src/LoopClosing.cc
src/ORBextractor.cc
src/ORBmatcher.cc
src/FrameDrawer.cc
src/Converter.cc
src/MapPoint.cc
src/KeyFrame.cc
src/Map.cc
src/MapDrawer.cc
src/Optimizer.cc
src/PnPsolver.cc
src/Frame.cc
src/KeyFrameDatabase.cc
src/Sim3Solver.cc
src/Initializer.cc
src/Viewer.cc
)上面的头文件,放在系统官方库中一起
2 系统官方库
统一先使用find_package
find_package(Eigen3 3.1.0 REQUIRED)
find_package(Pangolin REQUIRED)
find_package(OpenCV 3.0 QUIET)
再包含头文件
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
)最后再链接到1中的共享库
target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
)(二)生成自己的可执行文件
统一使用
add_executable 和 target_link_libraries 唯一的一个库名叫 ${PROJECT_NAME}
边栏推荐
猜你喜欢
随机推荐
In depth interpretation of happens before principle
Traversal recursion + iteration of binary tree
List and dictionary instance applications (※)
PyQt5快速开发与实战 第1章 认识PyQt5
Software Testing Overview: the background, essence and process of software testing
MySQL learning notes
Admit it, investing in new energy is for security
Dictionary and int matrix
BigDecimal's addition, subtraction, multiplication and division, size comparison, rounding up and down, and BigDecimal's set accumulation, judge whether BigDecimal has decimal
ThreadPoolExecutor是怎样执行任务的
Bash shell learning notes (II)
3Dunity游戏项目实战——飞机大战
Stringing of macro parameters and connection of macro parameters in C language
Bash shell学习笔记(二)
Shape matching Halcon template
脉冲波形的产生与变换
Visual conversion of nmap vulnerability scanning results
Bash shell learning notes (4)
easyui02
Smart contract DAPP system development process technology









