2

I followed the instructions here for including Eigen in my CMake project: https://eigen.tuxfamily.org/dox/TopicCMakeGuide.html

However, I do get the following cmake error:

Could not find a configuration file for package "Eigen3" that is compatible with requested version "3.2". The following configuration files were considered but not accepted:

/usr/lib/cmake/eigen3/Eigen3Config.cmake, version: unknown

What's odd is that it doesn't know the version of Eigen3Config.cmake. Here are the contents of Eigen3Config.cmake:

set ( EIGEN3_FOUND 1 )
set ( EIGEN3_USE_FILE     "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake" )

set ( EIGEN3_DEFINITIONS  "" )
set ( EIGEN3_INCLUDE_DIR  "/usr/include/eigen3" )
set ( EIGEN3_INCLUDE_DIRS "/usr/include/eigen3" )
set ( EIGEN3_ROOT_DIR     "/usr" )

set ( EIGEN3_VERSION_STRING "3.2.92" )
set ( EIGEN3_VERSION_MAJOR  "3" )
set ( EIGEN3_VERSION_MINOR  "2" )
set ( EIGEN3_VERSION_PATCH  "92" )

Is there something wrong with this file? I installed eigen using apt, so this file should be correct.

Guilty Spark
  • 77
  • 10
  • 1
    Does this answer your question? [Unable to find Eigen3 with CMake](https://stackoverflow.com/questions/34138879/unable-to-find-eigen3-with-cmake) – πάντα ῥεῖ Dec 14 '20 at 17:25
  • 1
    For version check to work, it should be `Eigen3ConfigVersion.cmake` script near it. Variables set by `Eigen3Config.cmake` are not treated by CMake as version specification. See [documentation](https://cmake.org/cmake/help/latest/command/find_package.html#version-selection) for `find_package` command. Eigen3 has always used weird scripts for being located by `find_package`. And this script seems to be not an exception: its content more suitable for `FindEigen3.cmake` script, which sets `Eigen3_FOUND` variable. (Note also the wrong case of variable which is actually set: `EIGEN3_FOUND`.) – Tsyvarev Dec 14 '20 at 17:51

0 Answers0