FindPkgConfig: Fix missing error text when library version is specified

Calls like `pkg_check_modules(somelibrary>=3.22)` that specify a version
requirement should still display an informative error when the package
is not found.  Fix our logic accordingly.
This commit is contained in:
Gautier Pelloux-Prayer 2016-11-24 11:14:29 +01:00 committed by Brad King
parent 8288d16126
commit cbccebbac9

View File

@ -381,8 +381,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
if (_pkg_check_modules_pkg_op)
list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
else()
list(APPEND _pkg_check_modules_exist_query --exists --print-errors --short-errors)
list(APPEND _pkg_check_modules_exist_query --exists)
endif()
list(APPEND _pkg_check_modules_exist_query --print-errors --short-errors)
_pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
_pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)