CMake: Add PCRE2 library selection depend on debug version availability

Use select_library_configurations to select applicable libraries
set for PCRE2.

Fixes: QTBUG-88092
Change-Id: I11e669a0142d53a3c344c86bd1d8eb797df4ba97
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2020-11-06 15:42:09 +01:00
parent ebf753d0ee
commit a66e5a3eca

View File

@ -24,9 +24,15 @@ if(NOT __pcre2_found)
find_path(PCRE2_INCLUDE_DIRS find_path(PCRE2_INCLUDE_DIRS
NAMES pcre2.h NAMES pcre2.h
HINTS ${PC_PCRE2_INCLUDEDIR}) HINTS ${PC_PCRE2_INCLUDEDIR})
find_library(PCRE2_LIBRARIES find_library(PCRE2_LIBRARY_RELEASE
NAMES pcre2-16 NAMES pcre2-16
HINTS ${PC_PCRE2_LIBDIR}) HINTS ${PC_PCRE2_LIBDIR})
find_library(PCRE2_LIBRARY_DEBUG
NAMES pcre2-16d pcre2-16
HINTS ${PC_PCRE2_LIBDIR})
include(SelectLibraryConfigurations)
select_library_configurations(PCRE2)
if(PC_PCRE2_VERSION) if(PC_PCRE2_VERSION)
set(WrapSystemPCRE2_VERSION "${PC_PCRE2_VERSION}") set(WrapSystemPCRE2_VERSION "${PC_PCRE2_VERSION}")
endif() endif()