Fix check for pcre2 using cmake

When PCRE2 is compiled using cmake, a pcre2 cmake file is installed
and Qt fails to configure because components isn't specified for
find_package.
In recent PCRE2 releases components needs to be specified for
find_package.

Fixes: QTBUG-102358
Pick-to: 6.2 6.3
Change-Id: Ib842b2c4b1c0bf38aa5da5475eaa2b3c56c6b822
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Jonas Kvinge 2022-04-06 21:09:17 +02:00
parent 9ab06e6185
commit 1007aac63a

View File

@ -4,7 +4,7 @@ if(TARGET WrapSystemPCRE2::WrapSystemPCRE2)
endif()
set(WrapSystemPCRE2_REQUIRED_VARS __pcre2_found)
find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG QUIET)
find_package(PCRE2 COMPONENTS 16BIT ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG QUIET)
set(__pcre2_target_name "PCRE2::pcre2-16")
if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}")