From ddca8374dc3f76d28916ad3c57dd0d7c274c2a67 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Sat, 12 Aug 2023 20:36:54 +0700 Subject: [PATCH] respect GNU install dirs CMAKE_INSTALL_LIBDIR is allowed to be an absolute path. Use CMAKE_INSTALL_FULL_LIBDIR instead. --- CBLAS/cmake/cblas-config-install.cmake.in | 8 ++------ LAPACKE/cmake/lapacke-config-install.cmake.in | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CBLAS/cmake/cblas-config-install.cmake.in b/CBLAS/cmake/cblas-config-install.cmake.in index 44046a283b..95b1f71941 100644 --- a/CBLAS/cmake/cblas-config-install.cmake.in +++ b/CBLAS/cmake/cblas-config-install.cmake.in @@ -1,11 +1,8 @@ # Compute locations from /@{LIBRARY_DIR@/cmake/lapacke-/.cmake get_filename_component(_CBLAS_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_CBLAS_PREFIX "${_CBLAS_SELF_DIR}" PATH) -get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH) -get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH) # Load the LAPACK package with which we were built. -set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") +set(LAPACK_DIR "@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") find_package(LAPACK NO_MODULE) # Load lapacke targets from the install tree. @@ -14,10 +11,9 @@ if(NOT TARGET @CBLASLIB@) endif() # Report lapacke header search locations. -set(CBLAS_INCLUDE_DIRS ${_CBLAS_PREFIX}/include) +set(CBLAS_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@) # Report lapacke libraries. set(CBLAS_LIBRARIES @CBLASLIB@) -unset(_CBLAS_PREFIX) unset(_CBLAS_SELF_DIR) diff --git a/LAPACKE/cmake/lapacke-config-install.cmake.in b/LAPACKE/cmake/lapacke-config-install.cmake.in index 8e735c0f27..0eafa39785 100644 --- a/LAPACKE/cmake/lapacke-config-install.cmake.in +++ b/LAPACKE/cmake/lapacke-config-install.cmake.in @@ -1,11 +1,8 @@ # Compute locations from /@{LIBRARY_DIR@/cmake/lapacke-/.cmake get_filename_component(_LAPACKE_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_SELF_DIR}" PATH) -get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH) -get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH) # Load the LAPACK package with which we were built. -set(LAPACK_DIR "${_LAPACKE_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") +set(LAPACK_DIR "@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") find_package(LAPACK NO_MODULE) # Load lapacke targets from the install tree. @@ -17,10 +14,9 @@ endif() set(LAPACKE_Fortran_COMPILER_ID ${LAPACK_Fortran_COMPILER_ID}) # Report lapacke header search locations. -set(LAPACKE_INCLUDE_DIRS ${_LAPACKE_PREFIX}/include) +set(LAPACKE_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@) # Report lapacke libraries. set(LAPACKE_LIBRARIES @LAPACKELIB@ ${LAPACK_LIBRARIES}) -unset(_LAPACKE_PREFIX) unset(_LAPACKE_SELF_DIR)