Summary: | CMake Install uses absolute paths in FindEigen3.cmake | ||||||
---|---|---|---|---|---|---|---|
Product: | Eigen | Reporter: | Clemens Arth <clemens.arth> | ||||
Component: | General | Assignee: | Nobody <eigen.nobody> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Compilation Problem | CC: | bjornpiltz, chtz, gael.guennebaud, jacob.benoit.1, pegua1 | ||||
Priority: | Normal | ||||||
Version: | unspecified | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Bug Depends on: | |||||||
Bug Blocks: | 558 | ||||||
Attachments: |
|
I missed this issue when I reported Bug #1347. My fix is slightly different. Yes I agree there is a big issue here. There is a pull-request implementing imported targets with other cmake fixes: https://bitbucket.org/eigen/eigen/pull-requests/255/cmake-added-eigen3-eigen-imported-target It would be very helpful if you could quickly review it to assess it properly cover your issue. I implemented a fix for this issue without hardcoding the relative value of CMAKECONFIG_INSTALL_DIR in https://bitbucket.org/eigen/eigen/pull-requests/267/make-cmake-config-file-relocatable/diff . Fixed by merging https://bitbucket.org/eigen/eigen/pull-requests/267 -- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1346. |
Created attachment 752 [details] 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, 1) you build Eigen temporarily into /tmp/eigen/eigen_install 2) you tar eigen_install into eigen_install.tgz 3) you build some other project, say /tmp/myproject 4) 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.