簡體   English   中英

在Windows中配置cmake項目時找不到Eigen3_DIR

[英]Not found Eigen3_DIR when configuring a cmake project in Windows

我想編譯一個打開的項目 ,它需要Eigen3,我遵循了它的指導方針,但仍停留在此步驟中:

“將環境變量Eigen3_DIR設置為{YOUR_EIGEN3_DIRECTORY} / eigen3 / cmake。”

我已經安裝了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.

但是我已經從這里下載了Eigen3,並設置了Eigen3_DIR如下 在此處輸入圖片說明 那我該怎么辦呢? 我只是cmake的初學者。

我假設您正在使用Windows。 您將需要安裝Visual Studio。 您可以使用社區版本。 您將需要執行以下操作:

  1. 在您的Eigen目錄中創建一個名為“ build”的目錄。
  2. 轉到構建目錄並執行“ cmake ..”。 這將創建Visual Studio項目。
  3. 使用Visual Studio加載.sln。
  4. 構建解決方案。
  5. 確保還建立了名為INSTALL的項目。

這將在安裝目錄中創建Eigen3Config.cmake文件。 在我的情況下,安裝目錄為“ C:\\ Program Files(X86)\\ Eigen3。使用它作為Eigen3_DIR變量的值。默認情況下,Eigen並不隨Eigen3Config.cmake文件一起提供。您將看到Eigen3Config.cmake.in文件,用於構建Eigen3Config.cmake文件。

HTH

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM