From 946846aaf5f2f29c27769a5be0021d21ec2ae542 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 24 Apr 2018 18:34:47 +0200 Subject: FindPkgConfig: do not unset unused variable _props is never used, it was a leftover from a development step. --- Modules/FindPkgConfig.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 952ca92658..415e914297 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -222,7 +222,6 @@ function(_pkg_create_imp_target _prefix _no_cmake_path _no_cmake_environment_pat AND ( ${_prefix}_INCLUDE_DIRS OR _libs OR ${_prefix}_CFLAGS_OTHER )) add_library(PkgConfig::${_prefix} INTERFACE IMPORTED) - unset(_props) if(${_prefix}_INCLUDE_DIRS) set_property(TARGET PkgConfig::${_prefix} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_prefix}_INCLUDE_DIRS}") -- cgit v1.2.1 From 7d756f37cc0dcd3dfff1c8524db5943af023cff8 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 24 Apr 2018 19:23:26 +0200 Subject: 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 --- Modules/FindBLAS.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 8e8c6f4f2d..5223b1d0b6 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) -- cgit v1.2.1