The DESTINATION provided to the `install` command should not be prefixed with ${CMAKE_INSTALL_PREFIX} - it breaks things like CMAKE_STAGING_PREFIX (and probably other use cases as well). From `cmake --help-command install`: DESTINATION arguments specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX. The prefix can be relocated at install time using DESTDIR mechanism explained in the CMAKE_INSTALL_PREFIX variable documentation. So, for example, instead of: set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/eigen3" CACHE INTERNAL "The directory where we install the header files (internal)" ) It should simply be: set(INCLUDE_INSTALL_DIR "include/eigen3" CACHE INTERNAL "The directory where we install the header files (internal)" )
Thank you for the hint, fixed in devel and 3.2 branches: https://bitbucket.org/eigen/eigen/commits/d26ebad https://bitbucket.org/eigen/eigen/commits/1f02e55
This unfortunately breaks the eigen3.pc file, which now has Cflags: -Iinclude/eigen3 instead of Cflags: -I/usr/include/eigen3
Created attachment 622 [details] Fix CMAKE_INSTALL_PREFIX missing from generated eigen3.pc
The attached patch follows the convention described at the bottom of this page: https://autotools.io/pkgconfig/file-format.html
That patch won't work because ${prefix} will be replaced by an empty string when cmake configures the file, since it thinks that its a variable which it should replace.
Created attachment 623 [details] Fix CMAKE_INSTALL_PREFIX missing from generated eigen3.pc Whoops, you're right. This updated patch fixes that -- and has actually be tested this time :-)
Thanks
Actually, the eigen3.pc wasn't the only thing that broke. Here's a more complete patch to fix the CMAKE_INSTALL_PREFIX correctness in Eigen: https://bitbucket.org/eigen/eigen/pull-requests/143/
Updated pull request: https://bitbucket.org/eigen/eigen/pull-requests/144/
*** Bug 1114 has been marked as a duplicate of this bug. ***
Thank you for the updated PR. devel: https://bitbucket.org/eigen/eigen/commits/1db6cf71f628/ 3.2: https://bitbucket.org/eigen/eigen/commits/35a341924dae/
*** Bug 1072 has been marked as a duplicate of this bug. ***
-- 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/1100.