Use cmake's generate_export_header.