Eigen3Config.cmake contains absolut paths.
Submitted by Björn Piltz
Assigned to Nobody
Link to original bugzilla bug (#1347)
Version: 3.3 (current stable)
Description
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 (closed). 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_ROOT_DIR "@EIGEN_ROOT_DIR@" )
<set ( EIGEN3_INCLUDE_DIR "@EIGEN_INCLUDE_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