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
发布评论