【SLAM中的问题相关解决方案】

本文档介绍了如何使用CMake构建和安装GoogleTest库,包括作为独立项目和集成到现有CMake项目中。同时,针对在CSPARSE库中遇到的包名不匹配问题,提供了修改FindCSparse.cmake文件的解决方法,确保find_package结果变量遵循预期模式。

SLAM在运行中的问题
问题一:安装gtest参考官方的安装文档

Generic Build Instructions

Setup

To build GoogleTest and your tests that use it, you need to tell your build
system where to find its headers and source files. The exact way to do it
depends on which build system you use, and is usually straightforward.

Build with CMake

GoogleTest comes with a CMake build script
(CMakeLists.txt)
that can be used on a wide range of platforms (“C” stands for cross-platform.).
If you don’t have CMake installed already, you can download it for free from
http://www.cmake.org/.

CMake works by generating native makefiles or build projects that can be used in
the compiler environment of your choice. You can either build GoogleTest as a
standalone project or it can be incorporated into an existing CMake build for
another project.

Standalone CMake Project

When building GoogleTest as a standalone project, the typical workflow starts
with

git clone https://github.com/google/googletest.git -b release-1.11.0
cd googletest        # Main directory of the cloned repository.
mkdir build          # Create a directory to hold the build output.
cd build
cmake ..             # Generate native build scripts for GoogleTest.

The above command also includes GoogleMock by default. And so, if you want to
build only GoogleTest, you should replace the last command with

cmake .. -DBUILD_GMOCK=OFF

If you are on a *nix system, you should now see a Makefile in the current
directory. Just type make to build GoogleTest. And then you can simply install
GoogleTest if you are a system administrator.

make
sudo make install    # Install in /usr/local/ by default

If you use Windows and have Visual Studio installed, a gtest.sln file and
several .vcproj files will be created. You can then build them using Visual
Studio.

On Mac OS X with Xcode installed, a .xcod

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值