Skip to content

Commit 9be2bd8

Browse files
committed
Fix Findlibpcre2-8: resolve PCRE2::8BIT alias before aliasing
1 parent bd94f9a commit 9be2bd8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cmake/Findlibpcre2-8.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
find_package(pcre2 CONFIG REQUIRED)
44

55
if (TARGET PCRE2::8BIT AND NOT TARGET libpcre2-8::libpcre2-8)
6-
add_library(libpcre2-8::libpcre2-8 ALIAS PCRE2::8BIT)
6+
# Resolve PCRE2::8BIT to its underlying IMPORTED target before aliasing,
7+
# matching the approach used by the BDE vcpkg port.
8+
get_target_property(_pcre2_actual PCRE2::8BIT ALIASED_TARGET)
9+
if (_pcre2_actual)
10+
add_library(libpcre2-8::libpcre2-8 ALIAS "${_pcre2_actual}")
11+
else()
12+
add_library(libpcre2-8::libpcre2-8 ALIAS PCRE2::8BIT)
13+
endif()
714
endif()
815

916
set(libpcre2-8_FOUND TRUE)

0 commit comments

Comments
 (0)