diff options
Diffstat (limited to 'cmake/FindWrapSystemPCRE2.cmake')
-rw-r--r-- | cmake/FindWrapSystemPCRE2.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake index f8ed5ff7a0..61e0d2fb5b 100644 --- a/cmake/FindWrapSystemPCRE2.cmake +++ b/cmake/FindWrapSystemPCRE2.cmake @@ -1,12 +1,15 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + if(TARGET WrapSystemPCRE2::WrapSystemPCRE2) set(WrapSystemPCRE2_FOUND TRUE) return() endif() set(WrapSystemPCRE2_REQUIRED_VARS __pcre2_found) -find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG QUIET) +find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT QUIET) -set(__pcre2_target_name "PCRE2::pcre2-16") +set(__pcre2_target_name "PCRE2::16BIT") if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}") # Hunter case. set(__pcre2_found TRUE) @@ -19,7 +22,7 @@ if(NOT __pcre2_found) list(PREPEND WrapSystemPCRE2_REQUIRED_VARS PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS) find_package(PkgConfig QUIET) - pkg_check_modules(PC_PCRE2 QUIET libpcre2-16) + pkg_check_modules(PC_PCRE2 QUIET "libpcre2-16") find_path(PCRE2_INCLUDE_DIRS NAMES pcre2.h |