Add more/better GNUInstallDirs variables usage
- Use more of GNUInstallDirs' installation location variables:
DATAROOTDIR
,INCLUDEDIR
- Don't assume that prepending
CMAKE_INSTALL_PREFIX
to any of the location variables makes sense. There is no guarantee that install locations are relative to the prefix (seeCMAKE_INSTALL_<location>
documentation) - forcefully prepending the prefix to them can generate nonsense.CMAKE_INSTALL_FULL_<location>
is what should be used to get a guaranteed-absolute version of the locations.
The pkg-config file referred to a seemingly-nonexistent LIB_INSTALL_DIR
variable for the libdir
value, I've replaced it with CMAKE_INSTALL_FULL_LIBDIR
. This never caused an issue before because the Libs
line doesn't actually use the libdir
variable, neither is the includedir
one for the Cflags
. Maybe the file should be rewritten abit to use the pkg-config variables?