You want to look up a package named foo via pkg-config, but if you can't find it that way, you want to fall back to a library named bar (perhaps because the naming conventions are slightly different). There's currently no good way to do this.
Solution
Add a libs option that lets you list library names to use in case of a pkg-config lookup failure. By default, this should just be the package name, since they're usually the same. This could also be used to replace the header_only argument, since you could just pass libs=None for that.
Bonus
Make sure package() throws an easy-to-catch exception if it can't find the package so that people writing bfg files can do whatever they like in that case.
Problem
You want to look up a package named
foo
via pkg-config, but if you can't find it that way, you want to fall back to a library namedbar
(perhaps because the naming conventions are slightly different). There's currently no good way to do this.Solution
Add a
libs
option that lets you list library names to use in case of a pkg-config lookup failure. By default, this should just be the package name, since they're usually the same. This could also be used to replace theheader_only
argument, since you could just passlibs=None
for that.Bonus
Make sure
package()
throws an easy-to-catch exception if it can't find the package so that people writing bfg files can do whatever they like in that case.