cmake: Generate list of header files for each component

In addition to generating a list of includes, also output
a list of absolute filenames to match.
cmake: link header tests with needed libraries

This is needed to correctly order parallel building
to ensure that headers are generated before they are
used for building.  The header tests don't strictly
require linking against the library for any functional
reason, but require the dependency to be present to
permit race-free compilation.