New user self-registration is currently disabled. Please email eigen-core-team @ if you need an account.
Bug 1347 - Eigen3Config.cmake contains absolut paths.
Eigen3Config.cmake contains absolut paths.
Product: Eigen
Classification: Unclassified
Component: General
3.3 (current stable)
All All
: Normal Unknown
Assigned To: Nobody
Depends on:
Blocks: 3.3
  Show dependency treegraph
Reported: 2016-11-22 10:12 UTC by Björn Piltz
Modified: 2016-12-06 10:37 UTC (History)
3 users (show)


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:

>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:
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:

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

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