From 70f15d202f1bfed7a08a36a5977cc94a1a829e2f Mon Sep 17 00:00:00 2001 From: "Dr. Thomas Orgis" Date: Wed, 15 Jun 2022 00:41:06 +0200 Subject: Modules/Find{BLAS,LAPACK}: allow choice of pkg-config package The BLA_PREFER_PKGCONFIG switch is not that useful if you are not able to specify the pkg-config package to use. This adds BLA_PKGCONFIG_BLAS and BLA_PKGCONFIG_LAPACK to that effect, allowing user choice in environments that install differing variants of the BLAS libraries with distinct .pc file names. This is part of work to get more standardized installations of the BLAS libs with specific names, likely blas.pc and lapack.pc only for Netlib reference code, or maybe blas-netlib.pc and lapack-netlib.pc, in any case distinct from choices like openblas-openmp.pc. --- Modules/FindLAPACK.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Modules/FindLAPACK.cmake') diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 50d4ebd264..699ab7e23c 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -35,6 +35,13 @@ The following variables may be set to influence this module's behavior: if set ``pkg-config`` will be used to search for a LAPACK library first and if one is found that is preferred +``BLA_PKGCONFIG_LAPACK`` + .. versionadded:: 3.25 + + If set, the ``pkg-config`` method will look for this module name instead of + just ``lapack``. + + ``BLA_SIZEOF_INTEGER`` .. versionadded:: 3.22 @@ -278,8 +285,11 @@ endif() # Search with pkg-config if specified if(BLA_PREFER_PKGCONFIG) + if(NOT BLA_PKGCONFIG_LAPACK) + set(BLA_PKGCONFIG_LAPACK "lapack") + endif() find_package(PkgConfig QUIET) - pkg_check_modules(PKGC_LAPACK QUIET lapack) + pkg_check_modules(PKGC_LAPACK QUIET ${BLA_PKGCONFIG_LAPACK}) if(PKGC_LAPACK_FOUND) set(LAPACK_FOUND TRUE) set(LAPACK_LIBRARIES "${PKGC_LAPACK_LINK_LIBRARIES}") -- cgit v1.2.1