zoukankan      html  css  js  c++  java
  • 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 )
    然后就可以啦。
  • 相关阅读:
    使用Docker容器来源码编译etcd
    PHP开发第一个扩展
    CI框架SESSION重写
    XMLHttpRequest的跨域请求
    PHP哈希表碰撞攻击
    empty、isset、is
    PHP实现4种排序算法
    C实现9种排序算法
    Debian、Ubuntu常用命令大全
    Java中 int和Integer的区别+包装类
  • 原文地址:https://www.cnblogs.com/YouXiangLiThon/p/8671321.html
Copyright © 2011-2022 走看看