diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-06-30 13:30:42 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-07-05 08:18:21 +0000 |
commit | a83a943bff4d7eb4b2f4ae57c2b736ad83f799a7 (patch) | |
tree | 29bae0f9fb518b3aad587ec746c81831059e408b /cmake/FindWrapSystemPCRE2.cmake | |
parent | 3e36d8144ec185d7f57d75c9885cf5633c1d3f28 (diff) |
CMake: Don't force CONFIG mode when looking for system PCRE2
This allows picking up 3rd party Find modules. One use case is
Conan-generated Find modules.
Also add TODO in case we ever need to handle finding the upstream
target name rather than the Hunter chosen one.
Fixes: QTBUG-104542
Change-Id: I243987c657f74e8127076666d9734b2b657bc0ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit af56a6f0cb61b45b13fe9efde12bc39b01030fc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake/FindWrapSystemPCRE2.cmake')
-rw-r--r-- | cmake/FindWrapSystemPCRE2.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake index f35ee8c23b..f8516d3b81 100644 --- a/cmake/FindWrapSystemPCRE2.cmake +++ b/cmake/FindWrapSystemPCRE2.cmake @@ -4,8 +4,12 @@ if(TARGET WrapSystemPCRE2::WrapSystemPCRE2) endif() set(WrapSystemPCRE2_REQUIRED_VARS __pcre2_found) -find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT CONFIG QUIET) +find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT QUIET) +# TODO: pcre2-16 is not the target name provided by the upstream Config file. It is PCRE2::16BIT. +# https://github.com/PCRE2Project/pcre2/blob/2410fbe3869cab403f02b94caa9ab37ee9f5854b/cmake/pcre2-config.cmake.in#L122 +# We don't strictly need to handle that though, because the pkg-config code path below still +# finds the correct libraries. set(__pcre2_target_name "PCRE2::pcre2-16") if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}") # Hunter case. |