WIP: cmake: Improve the generation of config.h to be more consistent with the behavior of autotools
In addition to improving the cmake macro autoheadercheck, these commits make the generation of the config.h file more like that of autotools.
Fixes #117, depends on !227 (merged), !230 (merged), !231 (merged)
Edited by Ralf Habacker