CMake: Fix check for system harfbuzz if pkg-config is unavailable

We need to check whether pkg_check_modules returns success before
setting up target name etc.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-103894
Change-Id: I12702639683723d976e93be95443099b88885869
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2022-06-09 16:35:44 +02:00
parent 4cef4f1c1b
commit 71a0b893fb

View File

@ -32,7 +32,7 @@ if(__harfbuzz_broken_config_file OR NOT __harfbuzz_found)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_HARFBUZZ harfbuzz IMPORTED_TARGET)
if(PC_HARFBUZZ_FOUND)
find_path(HARFBUZZ_INCLUDE_DIRS
NAMES harfbuzz/hb.h
HINTS ${PC_HARFBUZZ_INCLUDEDIR})
@ -46,6 +46,7 @@ if(__harfbuzz_broken_config_file OR NOT __harfbuzz_found)
set(WrapSystemHarfbuzz_VERSION "${PC_HARFBUZZ_VERSION}")
endif()
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WrapSystemHarfbuzz