Could not find a package,configuration file provided by "G2O" ,G2OConfig.cmake,g2o-config.cmake

 因为项目需要使用到g2o,所以自己从git上面clone下来,

git clone https://github.com/RainerKuemmerle/g2o.git

然后:

cd g2o

mkdir build

cd build

cmake ..

make -j4

 编译完成,并在CMakeLists.txt使用g2o:

set(G2O_DIR ..)

find_package(....

但是后面报这个错误:

CMake Error at CMakeLists.txt:11(find_package):
By not providing "FindG2O.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "G2O", but
CMake did not find one.

Could not find a package configuration file provided by "G2O" with any of
the following names:

G2OConfig.cmake
g2o-config.cmake

Add the installation prefix of "G2O" to CMAKE_PREFIX_PATH or set "G2O_DIR"
to a directory containing one of the above files. If "G2O" provides a
separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!

 

其实是我链接的g2o错误了,应该这样:

LIST( APPEND CMAKE_MODULE_PATH /XXX/g2o/cmake_modules )
SET( G2O_ROOT /home/xxx/g2o )
FIND_PACKAGE( G2O REQUIRED )
然后就可以啦。

转载于:https://www.cnblogs.com/YouXiangLiThon/p/8671321.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值