#1008 Allow installing binaries to subdirectory while keeping CMake package scripts in the same place #1009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As suggested in #1008, this PR adds the project option
LAPACK_BINARY_PATH_SUFFIX
.It names a subdirectory added to the install location of all LAPACK
binaries. It is empty by default.
This allows a consumer, to install the Reference LAPACK binaries into a
subdirectory of, e.g.,
/usr/local/lib
without inadvertantly changing theinstall location of the CMake package scripts, which remain unchanged in
/usr/local/lib/cmake
.This can be necessary to avoid conflicts with other BLAS/LAPACK
distributions. Previously, this would require the consumer to override
CMAKE_INSTALL_LIBDIR
directly. This shouldn't be done, though, becausethe variable is provided by the core CMake module GNUInstallDirs and is
used in many places. Thus, changing it can have unforeseen consequences.
Here, overriding it also changed the install locations of the CMake
package scripts and PKGConfig files, which prevents them from being
discovered by default by their respective tools.
This PR also fixes the CMake install instructions in the LAPACK README. They recommended the use of
CMAKE_INSTALL_LIBDIR
from the command line, which is bad practice (see above). Now, theCMAKE_INSTALL_PREFIX
variable is recommended instead, as intended by the CMake authors.Closes #1008.
Checklist