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 )
    然后就可以啦。
  • 相关阅读:
    洛谷 P1555 尴尬的数字
    洛谷 P1318 积水面积
    9.8解题报告
    洛谷 P1464 Function
    洛谷 P1122 最大子树和
    cogs 66. [HAOI2004模拟] 数列问题
    49. 跳马问题
    洛谷 P3137 [USACO16FEB]圆形谷仓Circular Barn_Silver
    codevs 3164 质因数分解
    codeforces 482C Game with Strings
  • 原文地址:https://www.cnblogs.com/YouXiangLiThon/p/8671321.html
Copyright © 2011-2022 走看看