Update pacakge config for subproject config generation

When building several subprojects that depend on each other, we need to write a config
file into the build directory so that the next project to call find_package will pick
up the right settings.