jimporter / bfg9000

bfg9000 - build file generator
https://jimporter.github.io/bfg9000
BSD 3-Clause "New" or "Revised" License
76 stars 21 forks source link

Allow fallback libs for package() #84

Closed jimporter closed 7 years ago

jimporter commented 7 years ago

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 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.