After emerging dev-libs/libfmt-5.2.1 I attempted to use it with pkg-config, but it found nothing under the usual name `fmt`. I investigated with `equery f libfmt` and found that no `.pc` files were installed, which I believe to be a packaging error.
The sources do not provide .pc files so if the error is there, then that's an upstream packaging error.
Upstream doesn't install a pkgconfig in the current release (5.2.1). However, they recently added this functionality: https://github.com/fmtlib/fmt/pull/916 You'll have to wait for the next libfmt release or use the -9999 version.