From a66e5a3ecad594607e68305d7afc8e7bbfcfe843 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Fri, 6 Nov 2020 15:42:09 +0100 Subject: [PATCH] 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 --- cmake/FindWrapSystemPCRE2.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake index 6d8b471f88..f8ed5ff7a0 100644 --- a/cmake/FindWrapSystemPCRE2.cmake +++ b/cmake/FindWrapSystemPCRE2.cmake @@ -24,9 +24,15 @@ if(NOT __pcre2_found) find_path(PCRE2_INCLUDE_DIRS NAMES pcre2.h HINTS ${PC_PCRE2_INCLUDEDIR}) - find_library(PCRE2_LIBRARIES + find_library(PCRE2_LIBRARY_RELEASE NAMES pcre2-16 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) set(WrapSystemPCRE2_VERSION "${PC_PCRE2_VERSION}") endif()