CMake Error: not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH
Posted sea-stream
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CMake Error: not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH相关的知识,希望对你有一定的参考价值。
一.第一种解决方法
cd /usr/share/ ,cma tab补全,可以找到两个版本的cmake(cmake2.8和cmake3.5)
把/usr/share/cmake2.8/Modules/ 下的FindEigen3.cmake文件复制到cmake3.5对应目录下,即可解决
二.第二种解决方法
1、找到FindEigen3.cmake文件,/usr/share/cmake2.8/Modules
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_modules find_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()
以上是关于CMake Error: not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH的主要内容,如果未能解决你的问题,请参考以下文章
已解决CMake Error: Cannot determine link language for target “xxx“. CMake Error: CMake can not determ
已解决CMake Error: Cannot determine link language for target “xxx“. CMake Error: CMake can not determ
CMake error:System Error:No such file or directory CMake error:Could not open file for write in cop
C++学习(二六一)CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH
cmake cmake MSBUILD : error MSB1009: 项目文件不存在 or MSBuild.exe not find !