-
Notifications
You must be signed in to change notification settings - Fork 474
Description
Currently, both compiled binaries and CMake package scripts are installed to the same location using the CMake variable ${CMAKE_INSTALL_LIBDIR}
(CMake scripts go to the subdirectory cmake
). If you want to install the binaries to a subdirectory (e. g. /usr/local/lib/lapack
to avoid conflicts with other distributions), you have to modify this variable from the command line. Unfortunately, because the CMake scripts also use this variable, their install location changes to /usr/local/lib/lapack/cmake
. This is a non-standard location that will not be automatically picked up by CMake.
Proposed new feature: Please support installing the binaries to a subdirectory of ${CMAKE_INSTALL_LIBDIR}
while keeping the CMake package scripts in the same, default-discoverable location.
Possible solutions: Introduce project variables for the binary and/or the CMake script install location, that can be individually overridden by the consumer.
Personally, I think it's a bad idea to force the user to override a variable that is provided by the CMake module GNUInstallDirs
, if they want to customize the install location. This can have unforeseen consequences.
Thus, I would propose to change this macro to not use ${CMAKE_INSTALL_LIBDIR}
and ${CMAKE_INSTALL_BINDIR}
directly. Either, one could introduce two new project options containing the binary install paths relative to the install prefix, defaulting to the current values. Or one could introduce a $LAPACK_BINARY_PATH_SUFFIX
project option (PATH SUFFIX
is the wording CMake uses in their documentation of find_package()
) defaulting to the empty string and append that to the current values.
I'm happy to provide a PR, but I'll wait for feedback first.