Eigen3Config.cmake 丢失

发布于 2025-01-10 16:22:39 字数 1179 浏览 0 评论 0原文

我正在尝试安装一个依赖于 Eigen 库的库。我在 Windows 10 中使用 Cmake 3.23.0-rc2 时遇到的错误。我得到这个

  CMake Error at CMakeLists.txt:25 (FIND_PACKAGE):
  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.

There are no Eigen3Config.cmake eigen3-config.cmake in Eigen library 我正在使用版本 3.2.4。由于这是一个仅包含标头的库,因此我没有在 Windows 10 中进行任何配置。一些​​人 建议添加这一行

list(APPEND CMAKE_MODULE_PATH "<path to eigen>/cmake")

但这并没有解决我的问题。这是 CMakeLists.txt 中的部分

CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
if(WIN32)
    ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
    FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
    INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
endif()

添加 Eigen 文件夹的路径并没有解决问题。

I'm trying to install a library which relies on Eigen library. The error I'm getting in Windows 10 using Cmake 3.23.0-rc2. I'm getting this

  CMake Error at CMakeLists.txt:25 (FIND_PACKAGE):
  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.

There are no Eigen3Config.cmake eigen3-config.cmake in Eigen library I'm using version 3.2.4. Since this is a header-only library, I didn't do any configuration in Windows 10. Some people suggest to add this line

list(APPEND CMAKE_MODULE_PATH "<path to eigen>/cmake")

But it didn't solve my problem. This is the part in CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
if(WIN32)
    ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
    FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
    INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
endif()

Adding path to the Eigen folder didn't solve the problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文