CMake Error: not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH

编译VINS-Mono (catkin_make)的时候,出现了这个错误,具体的错误如下:

CMake Error at VINS-Mono/vins_estimator/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.

百度了一下,找到一个解决方法,链接:
FindEigen3.cmake缺失解决办法

根据这个答案,以及查看对应工程的CMakeLists.txt文件,发现里面定义了CMAKE_MODULE_PATH但是没有相应的文件夹和文件,所以我搜索了一个FindEigen3.cmake文件放在一个新建的cmake文件夹里,然后放到工程目录下面,就搞定了。

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(Eigen3  REQUIRED)

ar_demo, benchmark_publisher, feature_tracker, vins_estimator 这四个工程都有这个问题,将带FindEiegn3.cmake文件的cmake文件夹复制到这四个文件夹就解决了,然后继续编译,没问题。


你可能感兴趣的:(CMake Error: not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH)