I'd rather not have to do this, as I don't really see the point in duplicating what is done in pkgconfig, but this is likely the easiest way to avoid nasty hacks.