Why do you want to create a “.cmp” file?
It is not needed in a normal KiCad workflow.
I think this is the best and most up-to-date beginners tutorial in text format for KiCad at the moment:
… and it does not mention the “.cmp” files at all.
But if you want to know. Those files are made by Pcbnew / File / Export / Footprint Association (.cmp) File