This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1347 - Eigen3Config.cmake contains absolut paths.
Summary: Eigen3Config.cmake contains absolut paths.
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: General (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3.3
  Show dependency treegraph
 
Reported: 2016-11-22 10:12 UTC by Björn Piltz
Modified: 2019-12-04 16:32 UTC (History)
3 users (show)



Attachments

Description Björn Piltz 2016-11-22 10:12:12 UTC
I'm happy Eigen has started supporting the Find_package(Eigen3 CONFIG) mode by including an Eigen3Config.cmake file. It wold be nice if it also provided an IMPORTED target like Alain suggests in Bug #1319. Howevever, EIGEN3_INCLUDE_DIR points to the absolute location of CMAKE_INSTALL_PREFIX when 'make install' was called. Thus not making the install dir relocatable. A more convenient solution would be to set a relative PATH like this:

<set ( EIGEN3_INCLUDE_DIR  "@EIGEN_INCLUDE_DIR@" )
<set ( EIGEN3_ROOT_DIR     "@EIGEN_ROOT_DIR@" )
---
>get_filename_component(EIGEN3_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
>set ( EIGEN3_INCLUDE_DIR  "${EIGEN3_ROOT_DIR}/include/eigen3" )


There is a also a new fancy syntax to achieve this described here: https://cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#creating-relocatable-packages
Comment 1 Gael Guennebaud 2016-11-23 10:40:21 UTC
Thanks a lot for the suggestion.

There is a pull-request implementing imported targets using the new syntax with fallback: 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.
Comment 2 Gael Guennebaud 2016-12-06 10:37:02 UTC
https://bitbucket.org/eigen/eigen/pull-requests/267
Comment 3 Nobody 2019-12-04 16:32:08 UTC
-- 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/1347.

Note You need to log in before you can comment on or make changes to this bug.