diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2019-09-04 16:36:34 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2019-09-16 17:02:08 (GMT) |
commit | 28cb86d7962b2a9b8e49dc62bccf6187761524d9 (patch) | |
tree | b5a897fb04f2952836f3933b7048363b75f7da9c /Modules/FindPkgConfig.cmake | |
parent | ee15bc7d7e7707fd8d7db92645c2c56a5df0f681 (diff) | |
download | CMake-28cb86d7962b2a9b8e49dc62bccf6187761524d9.zip CMake-28cb86d7962b2a9b8e49dc62bccf6187761524d9.tar.gz CMake-28cb86d7962b2a9b8e49dc62bccf6187761524d9.tar.bz2 |
FindPkgConfig: Allow libraries that can't be found with their full path
pkg-config's .pc files can sometimes provide libraries that are visible to
the linker but not present in CMake's known search paths. In the case
where CMake can find some, but not all of the library dependencies
provided in a .pc file, this allows them to be passed through as "-lfoo"
when the full path can't be found.
This also removes the test failure cases that occured because of this
scenario and adjsuts the remaining tests to account for not-found
libraries
Diffstat (limited to 'Modules/FindPkgConfig.cmake')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 4c9af91..5162a44 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -214,7 +214,11 @@ function(_pkg_find_libs _prefix _no_cmake_path _no_cmake_environment_path) NAMES ${_pkg_search} ${_find_opts}) mark_as_advanced(pkgcfg_lib_${_prefix}_${_pkg_search}) - list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}") + if(pkgcfg_lib_${_prefix}_${_pkg_search}) + list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}") + else() + list(APPEND _libs ${_pkg_search}) + endif() endforeach() set(${_prefix}_LINK_LIBRARIES "${_libs}" PARENT_SCOPE) |