加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 3.91 KB
一键复制 编辑 原始数据 按行查看 历史
JayChen1996 提交于 2023-03-30 10:00 . 在CMake中添加Qt界面库
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 17)
project(VIPL-SLAM)
# MACRO predefine the system, used in code to determine
if(WIN32)
add_compile_definitions(SYSTEM_WINDOWS)
elseif(UNIX)
add_compile_definitions(SYSTEM_LINUX)
endif()
MATH(EXPR stack_size "32*1024*1024")
set(M_SOURCES
main.cpp
camera/AbstractCamera.cpp
camera/RS_Camera.cpp
camera/LocalVideo.cpp
camera/USB_Camera.cpp
camera/USB_Camera.hpp
camera/ImageSet.cpp
camera/ImageSet.h
utils/FrameMetadata.cpp
utils/FrameMetadata.h
ui/map_vis.cpp
ui/map_vis.h
utils/ThreadCommBuffer.cpp
utils/ThreadCommBuffer.h
utils/utils.cpp
evaluation/evaluation_method.cpp
)
set(M_HEADERS
AbstractCamera.h
RS_Camera.hpp
LocalVideo.hpp
utils/utils.h
evaluation/evaluation_method.h
)
set(fmt_DIR /opt/fmt/8.1.1/lib/cmake/fmt)
set(OpenCV_DIR /opt/opencv/4.5.5_vino_ex/lib/cmake/opencv4)
set(Pangolin_DIR /opt/pangolin/0.6/lib/cmake/Pangolin)
set(g2o_DIR /opt/g2o/20201223_git/lib/cmake/g2o)
set(Eigen_DIR /opt/eigen3/share/eigen3/cmake)
set(Sophus_DIR /opt/sophus/share/sophus/cmake)
set(Qt5_DIR /opt/qt/Qt5.14.2/5.14.2/gcc_64/lib/cmake/Qt5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(OpenCV)
find_package(realsense2)
find_package(fmt REQUIRED)
find_package(Pangolin REQUIRED)
find_package(g2o REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Sophus REQUIRED)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${Pangolin_INCLUDE_DIRS})
include_directories(${realsense2_INCLUDE_DIRS})
include_directories(${g2o_INCLUDE_DIRS})
include_directories(${Eigen3_INCLUDE_DIRS})
include_directories(${Sophus_INCLUDE_DIRS})
include_directories(${fmt_INCLUDE_DIRS})
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Gui_INCLUDE_DIRS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
include_directories(
.
./evaluation
)
# 打印所有变量及其值
get_cmake_property(_variableNames VARIABLES)
foreach(_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
add_executable(VIPL-SLAM ${M_SOURCES})
target_link_libraries(VIPL-SLAM ${OpenCV_LIBS})
target_link_libraries(VIPL-SLAM pangolin)
target_link_libraries(VIPL-SLAM GL)
target_link_libraries(VIPL-SLAM realsense2)
target_link_libraries(VIPL-SLAM fmt)
set(TEST_SOURCES
test.cpp
utils/utils.cpp
camera/AbstractCamera.cpp
camera/ImageSet.cpp
evaluation/evaluation_method.cpp
)
add_executable(test ${TEST_SOURCES})
target_link_libraries(test ${OpenCV_LIBS})
target_link_libraries(test pangolin)
target_link_libraries(test GL)
target_link_libraries(test realsense2)
target_link_libraries(test Sophus::Sophus)
target_link_libraries(test fmt)
add_executable(
trajectory_visualization
utils/utils.cpp
evaluation/evaluation_method.cpp
trajectory_visualization/trajectory_plot.cpp
)
target_link_libraries(trajectory_visualization ${OpenCV_LIBS})
target_link_libraries(trajectory_visualization pangolin)
target_link_libraries(trajectory_visualization GL)
target_link_libraries(trajectory_visualization realsense2)
target_link_libraries(trajectory_visualization Sophus::Sophus)
target_link_libraries(trajectory_visualization fmt)
set(TEST_GUI_SOURCES
test_gui/ui/mainwindow.ui
test_gui/ui/mainwindow.cpp
test_gui/main.cpp
test_gui/resources/resources.qrc)
add_executable(test_gui ${TEST_GUI_SOURCES})
target_link_libraries(test_gui ${OpenCV_LIBS})
target_link_libraries(test_gui pangolin)
target_link_libraries(test_gui GL)
target_link_libraries(test_gui realsense2)
target_link_libraries(test_gui Sophus::Sophus)
target_link_libraries(test_gui fmt)
target_link_libraries(test_gui Qt5::Widgets)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化