CMake: make eigen3.pc relocatable to honor install-time --prefix
libeigen/eigen!2561 Closes #3068 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
co-authored by
Rasmus Munk Larsen
parent
54ab450b72
commit
461a996055
@@ -234,6 +234,12 @@ install(FILES
|
||||
)
|
||||
|
||||
if(EIGEN_BUILD_PKGCONFIG)
|
||||
# Walk back from the .pc file's location to the install prefix so
|
||||
# eigen3.pc resolves ${prefix} at lookup time via ${pcfiledir} and
|
||||
# honors install-time --prefix overrides.
|
||||
file(RELATIVE_PATH PKGCONFIG_RELATIVE_PATH_TO_PREFIX
|
||||
"${CMAKE_INSTALL_PREFIX}/${PKGCONFIG_INSTALL_DIR}"
|
||||
"${CMAKE_INSTALL_PREFIX}")
|
||||
configure_file(eigen3.pc.in eigen3.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
|
||||
DESTINATION ${PKGCONFIG_INSTALL_DIR})
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
prefix=${pcfiledir}/@PKGCONFIG_RELATIVE_PATH_TO_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
|
||||
Name: Eigen3
|
||||
|
||||
Reference in New Issue
Block a user