-
Notifications
You must be signed in to change notification settings - Fork 9
Description
What happened?
The package config file generated by Vernier includes absolute paths that point to the install locations. These are set when CMake is first run and will either point to the default GNUInstallVars path or the value of the --install-prefix command line argument, e.g.
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Libs: -L${libdir} -lvernier -lvernier_c -lvernier_f
Cflags: -I${includedir}
This means that setting --prefix with cmake --install will result in mismatched paths. It also means that the install cannot be easily relocated because the paths are absolute. One solution to this would be to change the variables to use ${pcfiledir} which expands to the directory containing the .pc file and which can be used with relative paths to make the installation relocatable, e.g.
libdir=${pcfiledir}/../
includedir=${pcfiledir}/../../@CMAKE_INSTALL_INCLUDEDIR@
This doesn't appear to be a problem if Vernier is installed with spack - presumably because spack edits the hardwired paths as one of its install actions.
Version
main