Ubuntu16.04 :By not providing FindEigen3.cmake in CMAKE

编程入门 行业动态 更新时间:2024-10-28 21:27:39

Ubuntu16.04 :By not providing “FindEigen3.cmake” in CMAKE_MODULE_PATH

今天下载了hector_slam的源码想要跑一下,结果编译不能通过,并且一直出现如下错误。这是由于cmakelist路径与安装路径不一致导致的,研究了一会儿,解决了,方法如下:
这是错误提示:

CMake Warning at hector_pressed_map_transport/CMakeLists.txt:13 (find_package):By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project hasasked CMake to find a package configuration file provided by "Eigen3", butCMake did not find one.Could not find a package configuration file provided by "Eigen3" with anyof the following names:Eigen3Config.cmakeeigen3-config.cmakeAdd 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 beeninstalled.

解决办法:
1、找到一个FindEigen3.cmake文件,直接在电脑里面搜索就行,应该会有的,找不到的请私我。。。
2、复制到自己这个的工程下
3、在工程的CMakeLists.txt里面。添加这句话:

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})*******就是这句,加上就行了。这样cmake就会到你自己工程目录下去找FindEigen3.cmake了。
find_package(Eigen3)
if(NOT EIGEN3_FOUND)# Fallback to cmake_modulesfind_package(cmake_modules REQUIRED)find_package(Eigen REQUIRED)set(EIGEN3_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})set(EIGEN3_LIBRARIES ${EIGEN_LIBRARIES})  # Not strictly necessary as Eigen is head only# Possibly map additional variables to the EIGEN3_ prefix.
else()set(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
endif()

原文链接:blog.csdn.net/handsome_for_kill/article/details/53288771

更多推荐

providing,CMAKE,cmake

本文发布于:2023-05-27 16:21:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/299908.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:providing   CMAKE   cmake

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!