zoukankan      html  css  js  c++  java
  • find_package()指令 “找不到FindGTSAM.cmake”

    find_package()查找包时搜索的哪些路径?

    find_package()查找包时搜索顺序

    一、在工作空间下编译Lego loam的代码,报错如下,

    CMake Error at LeGO-LOAM/LeGO-LOAM/CMakeLists.txt:23 (find_package):
      By not providing "FindGTSAM.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "GTSAM", but
      CMake did not find one.
    
      Could not find a package configuration file provided by "GTSAM" with any of
      the following names:
    
        GTSAMConfig.cmake
        gtsam-config.cmake
    
      Add the installation prefix of "GTSAM" to CMAKE_PREFIX_PATH or set
      "GTSAM_DIR" to a directory containing one of the above files.  If "GTSAM"
      provides a separate development package or SDK, be sure it has been
      installed.
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/gordon/ros_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/gordon/ros_ws/build/CMakeFiles/CMakeError.log".
    Makefile:13060: recipe for target 'cmake_check_build_system' failed
    make: *** [cmake_check_build_system] Error 1

    解决方法:

    1. 在terminal中使用 locate 指令查找本机是否有 GTSAMConfig.cmake 或 gtsam-config.cmake 及其所在路径

    2.  echo $PATH  和  echo $GTSAM_DIR  查看环境变量中是否包含上述路径。(一般是不包含的,所以编译时报错)。

    3. 往环境变量中添加上述路径。至此,一般都可以编译通过。

    二、编译pl-slam,报错如下,

      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.

    通过locate指令,我在 /usr/local/g2o/lib/cmake/g2o 中找到 g2oConfig.cmake 文件。使用以上方法添加路径后,依然报相同的错误。一番观察后,发现本机文件 g2oConfig.cmake 和报错内容有不相符的地方。于是尝试将本机文件改名,

    g2oConfig.cmake --> G2OConfig.cmake

    成功解决!

    三、在源码包中确实找不到 <PACKAGE>Config.cmake 或者 <package>-config.cmake 

    有两种方法:1)可能是 package-config 文件,不带cmake后缀;2)下策,自行创建 <PACKAGE>Config.cmake 或者 <package>-config.cmake ;

  • 相关阅读:
    Docker可视化管理工具Portainer
    Spring Cloud,Docker书籍资源、优秀博文等记录
    Grafana部署监控docker服务
    Grafana+Prometheus通过node_exporter监控Linux服务器信息
    Prometheus+Grafana+kafka_exporter监控kafka
    k8s gpu 资源设置
    mysql 塞数据
    idea 插件
    ubuntu 升级内核
    清华镜像站安装docker
  • 原文地址:https://www.cnblogs.com/gdut-gordon/p/10158574.html
Copyright © 2011-2022 走看看