mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
FindBLAS: do not write an imported target name into BLAS_LIBRARIES
Since commit v3.11.0-rc1~177^2 (FindBLAS: optionally query pkg-config for a library, 2017-12-15) the `BLAS_LIBRARIES` result variable may incorrectly contain the name of an imported target. Instead store the list of libraries in the variable. Unfortunately pkg_check_modules does not provide a way to get this so we need to use a (temporary) hack of reading `INTERFACE_LINK_LIBRARIES` from the interface library target. Fixes: #17934
This commit is contained in:
committed by
Brad King
parent
946846aaf5
commit
7d756f37cc
@@ -90,7 +90,11 @@ if(BLA_PREFER_PKGCONFIG)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKGC_BLAS IMPORTED_TARGET blas)
|
||||
if(PKGC_BLAS_FOUND)
|
||||
set(BLAS_LIBRARIES PkgConfig::PKGC_BLAS)
|
||||
# FIXME: We should not interpret the INTERFACE_LINK_LIBRARIES property
|
||||
# because it could have generator expressions and such. This is a
|
||||
# workaround for pkg_check_modules not providing a first-class way to
|
||||
# get the list of libraries.
|
||||
get_property(BLAS_LIBRARIES TARGET PkgConfig::PKGC_BLAS PROPERTY INTERFACE_LINK_LIBRARIES)
|
||||
find_package_handle_standard_args(BLAS
|
||||
REQUIRED_VARS BLAS_LIBRARIES
|
||||
VERSION_VAR PKGC_BLAS_VERSION)
|
||||
|
||||
Reference in New Issue
Block a user