The problem is that the bash completion dir uses a different prefix when
found by pkg-config. If the prefix is the same, all is well, otherwise
users end up looking for a different location and may suffer from
permissions denied errors.
This changeset fixes this by regex replacing the prefix of the path bash
completion directory. This changeset includes a change to the lookup
method for pkg-config vars. It has been changed to reflect the API of
FindPkgConfig. There are a lot of if-statements added to check which
version of CMake is used. This may not be needed, but.. this will help
any upgrade to CMake 3.4 and up. After which most of the code that has
been introduced by the changeset can be removed \o/.
I verified that building src and installing from this branch while $PREFIX=/usr/local resolves #478. This allows make install without being sudoer or root user to a dir I have access to.
The problem is that the bash completion dir uses a different prefix when found by pkg-config. If the prefix is the same, all is well, otherwise users end up looking for a different location and may suffer from permissions denied errors.
This changeset fixes this by regex replacing the prefix of the path bash completion directory. This changeset includes a change to the lookup method for pkg-config vars. It has been changed to reflect the API of FindPkgConfig. There are a lot of if-statements added to check which version of CMake is used. This may not be needed, but.. this will help any upgrade to CMake 3.4 and up. After which most of the code that has been introduced by the changeset can be removed \o/.
Fixes: #478
Signed-off-by: Wesley Schwengle wesley@schwengle.net