Bugzilla – Bug 1375
Eigen3ConfigVersion.cmake is not installed along with Eigen3Config.cmake with cmake v2.8
Last modified: 2017-01-24 08:18:22 UTC
Created attachment 765 [details]
Writes and installs Eigen3ConfigVersion.cmake even if cmake version 2.8 is used.
When using cmake to install eigen, eigen installs Eigen3Config.cmake, Eigen3ConfigVersion.cmake and UseEigen3.cmake if the cmake used is newer or equal to cmake 3.0. If the cmake is older (my installed version is 2.8.12), the Eigen3ConfigVersion.cmake file is not installed.
If this is the case and the project that depends on eigen tries to use FindEigen3.cmake, the cmake process will complain about how the Eigen3Config.cmake file was found, but cmake cannot determine the version:
CMake Warning at cmake/FindEigen3.cmake:73 (find_package):
Could not find a configuration file for package "Eigen3" that is compatible
with requested version "3.1".
The following configuration files were considered but not accepted:
/work/ehovland/ub/local/share/eigen3/cmake/Eigen3Config.cmake, version: unknown
This is because the CMakeLists.txt for eigen has special logic for any cmake older than 3.0 when building the Eigen3Config.cmake file and does not have write_basic_package_version_file() inside of the conditional for cmake versions older than 3.0 like it does for 3.0 or newer versions.
Thank you for the patch, I reworked it a bit: