diff options
author | Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de> | 2022-06-14 22:41:06 (GMT) |
---|---|---|
committer | Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de> | 2022-06-17 08:43:38 (GMT) |
commit | 70f15d202f1bfed7a08a36a5977cc94a1a829e2f (patch) | |
tree | ae4d08a49179f2375f5291023d392df392fc667c /Modules/FindBLAS.cmake | |
parent | ca8a5b05de811d6a95cfa7a33a2985f2b193967f (diff) | |
download | CMake-70f15d202f1bfed7a08a36a5977cc94a1a829e2f.zip CMake-70f15d202f1bfed7a08a36a5977cc94a1a829e2f.tar.gz CMake-70f15d202f1bfed7a08a36a5977cc94a1a829e2f.tar.bz2 |
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.
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r-- | Modules/FindBLAS.cmake | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 7a381af..d02c589 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -35,6 +35,12 @@ The following variables may be set to influence this module's behavior: if set ``pkg-config`` will be used to search for a BLAS library first and if one is found that is preferred +``BLA_PKGCONFIG_BLAS`` + .. versionadded:: 3.25 + + If set, the ``pkg-config`` method will look for this module name instead of + just ``blas``. + ``BLA_SIZEOF_INTEGER`` .. versionadded:: 3.22 @@ -273,8 +279,11 @@ endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) if(BLA_PREFER_PKGCONFIG) + if(NOT BLA_PKGCONFIG_BLAS) + set(BLA_PKGCONFIG_BLAS "blas") + endif() find_package(PkgConfig QUIET) - pkg_check_modules(PKGC_BLAS QUIET blas) + pkg_check_modules(PKGC_BLAS QUIET ${BLA_PKGCONFIG_BLAS}) if(PKGC_BLAS_FOUND) set(BLAS_FOUND ${PKGC_BLAS_FOUND}) set(BLAS_LIBRARIES "${PKGC_BLAS_LINK_LIBRARIES}") |