actually include target info in export config
move export functionality towards the end of CMakeLists.txt

This ensure that all referenced variables are actually defined.