Fix pkg-config file's includedir variable
-
INCLUDE_INSTALL_DIR
was being defined in too low of a scope for the top-level configure_file call to access it, resulting in anincludedir
of just${prefix}
. Fix this by moving its definition to the top-level CMakeLists. -
INCLUDE_INSTALL_DIR
was usinginclude
instead of the actual GNUInstallDirs variable that points at the requested location. Fix this by switching to the corresponding variable. Additionally,CMAKE_INSTALL_*DIR
variables can have full paths, so just prepending${prefix}
to it can result in nonsense paths. So we use theFULL
variant of the variable and also remove the${prefix}
, settingincludedir
to justINCLUDE_INSTALL_DIR
.