The package pcre2 is compatible with built-in CMake targets:

    # Each component imports a target:
    # TARGETS: pcre2::8BIT pcre2::16BIT pcre2::32BIT pcre2::POSIX
    find_package(pcre2 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE pcre2::8BIT pcre2::POSIX)
