How to generate a one-cabfile-per-component package when using CPack+WIX

Now I am trying packaging my project by using CPack+WIX, and I need to split my files into multiple cab files.

I know that after adding these elements:

  <Media Id="2" Cabinet="" EmbedCab="no"/>
  <Media Id="3" Cabinet="" EmbedCab="no"/>
  <Media Id="4" Cabinet="" EmbedCab="no"/>

into main.wxs by setting the CPACK_WIX_PATCH_FILE, I can get a xxx.msi with 3 cab files. But the cab files contain no file because it is also needed to add the attribute
“DiskId=num” into each File element or Component element in the files.wxs. However, I have thousands of files to be packed so it’s hardly possible to achieve this by writing the content into the CPACK_WIX_PATCH_FILE again.

So, is there any method that the CPack can generate the package which is composed of a .msi file and multiple .cab files, each cab file named after an install-component and containing all the files belonging to the same install-component?