Ubuntu18.04配置PL-VIO时catkin_make过程中:By not providing “FindEigen3.cmake“ in CMAKE_MODULE_PATH

Ubuntu18.04编译PL-VIO时遇到:By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH,原因是找不到FindEigen3.cmake,错误如下:

CMake Warning at src/PL-VIO/benchmark_publisher/CMakeLists.txt:26 (find_package):
  By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Eigen3", but
  CMake did not find one.

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

    Eigen3Config.cmake
    eigen3-config.cmake

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

然后我们看出错提示中的路径中的CmakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(benchmark_publisher)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++11 -DEIGEN_DONT_PARALLELIZE")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -rdynamic")


find_package(catkin REQUIRED COMPONENTS
    roscpp
    tf
    )

catkin_package()
include_directories(${catkin_INCLUDE_DIRS}) 

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(Eigen3  REQUIRED)
set(EIGEN3_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
include_directories(
  ${catkin_INCLUDE_DIRS}
  ${EIGEN3_INCLUDE_DIR}}
)

add_executable(benchmark_publisher
    src/benchmark_publisher_node.cpp
    )

target_link_libraries(benchmark_publisher ${catkin_LIBRARIES})

其中有一句set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake),我们就可以发现在该src/PL-VIO/benchmark_publisher/文件夹下没有发现cmake文件夹或者FindEigen3.cmake,接下来是解决办法:

1.在eigen源安装文件中搜索FindEigen3.cmake(如果默认安装的在usr/include/eigen3里找),并且在src/PL-VIO/benchmark_publisher/下建立一个cmake文件夹,将FindEigen3.cmake复制到该文件夹内。

2.接着把之前在catkin_ws中编译出来的build和devel文件夹删除(注意,要删除,我之前失败就是没删除),重新编译catkin_make即可。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值