summaryrefslogtreecommitdiffstats
path: root/Modules/FindBLAS.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2018-04-24 17:23:26 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-24 17:49:20 (GMT)
commit7d756f37cc0dcd3dfff1c8524db5943af023cff8 (patch)
treefe80fa869c9f39a1a09392948bba877acbd4ceb8 /Modules/FindBLAS.cmake
parent946846aaf5f2f29c27769a5be0021d21ec2ae542 (diff)
downloadCMake-7d756f37cc0dcd3dfff1c8524db5943af023cff8.zip
CMake-7d756f37cc0dcd3dfff1c8524db5943af023cff8.tar.gz
CMake-7d756f37cc0dcd3dfff1c8524db5943af023cff8.tar.bz2
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
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r--Modules/FindBLAS.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 8e8c6f4..5223b1d 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -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)