[英]Not found Eigen3_DIR when configuring a cmake project in Windows
I want to compile an open project , it needs Eigen3, I followed its guideline but stuck in this step: 我想编译一个打开的项目 ,它需要Eigen3,我遵循了它的指导方针,但仍停留在此步骤中:
"Set environment variable Eigen3_DIR to {YOUR_EIGEN3_DIRECTORY}/eigen3/cmake." “将环境变量Eigen3_DIR设置为{YOUR_EIGEN3_DIRECTORY} / eigen3 / cmake。”
I have installed CMake gui and it printed following errors after configuration 我已经安装了CMake gui并在配置后打印了以下错误
Make Error at src/CMakeLists.txt:15 (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.
But I have downloaded Eigen3 from here , and set the Eigen3_DIR
as follows 但是我已经从这里下载了Eigen3,并设置了
Eigen3_DIR
如下 So what should I do to fix it?
那我该怎么办呢? I am just a beginner in cmake.
我只是cmake的初学者。
I am assuming you are using Windows. 我假设您正在使用Windows。 You will need Visual Studio installed.
您将需要安装Visual Studio。 You can use the community version.
您可以使用社区版本。 You will need to do the following:
您将需要执行以下操作:
This will create the Eigen3Config.cmake file in your install directory. 这将在安装目录中创建Eigen3Config.cmake文件。 In my case the install directory was "C:\\Program Files(X86)\\Eigen3. Use this to as the value for Eigen3_DIR variable. By default Eigen does not come with the Eigen3Config.cmake file. You will see Eigen3Config.cmake.in file. This is used to build the Eigen3Config.cmake file.
在我的情况下,安装目录为“ C:\\ Program Files(X86)\\ Eigen3。使用它作为Eigen3_DIR变量的值。默认情况下,Eigen并不随Eigen3Config.cmake文件一起提供。您将看到Eigen3Config.cmake.in文件,用于构建Eigen3Config.cmake文件。
HTH HTH
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.