CMake Install uses absolute paths in FindEigen3.cmake
Submitted by Clemens Arth
Assigned to Nobody
Link to original bugzilla bug (#1346)
Description
Created attachment 752
Patch for Eigen 3.3.0 CMakeLists.txt file
I encountered a serious issue with the current CMakeLists.txt version, that is shipped with Eigen.
The install target is configured to use the ABSOLUTE paths of the install directory and to put that inside FindEigen3.cmake. This means that whatever you install Eigen to, the install folder might not be moved - this is a serious issue if you do continuous integration for example, where you build Eigen in one repo and your own project in an other repo for example. Because even if you tar the install folder, move it, and untar it again, AND you use your project to find Eigen with cmake, everything is messed up.
For example,
- you build Eigen temporarily into
/tmp/eigen/eigen_install - you tar eigen_install into eigen_install.tgz
- you build some other project, say /tmp/myproject
- you untar eigen_install.tgz into
/tmp/myproject/3rdparty
Whatever you do to find Eigen with CMake, it will not work, as in the FindEigen3.cmake you have INCLUDE_DIRS set to /tmp/eigen/eigen_install/include/eigen3, but it should be {DIR_OF_FindEigen3.cmake}/../../../include/eigen3
I attached a patch against the 3.3.0 CMakeLists.txt file that should work out.
Patch 752, "Patch for Eigen 3.3.0 CMakeLists.txt file":
CMakeLists_330_patch.diff