$ man pkg-config
In addition to specifying a package name on the command line, the full path to a given .pc file may be given instead. This allows a user to directly query a particular .pc file.
So yes, what you posted should work. Did you try it? Did you get an error? What version of pkg-config
? (mine is 0.26)
Alternatively, you can list additional package directories using the PKG_CONFIG_PATH
environment variable.