Involved in the biosynthesis of the yellow-orange carotenoid staphyloxanthin, which plays a role in the virulence via its protective function against oxidative stress. Catalyzes the head-to-head condensation of two molecules of farnesyl diphosphate (FPP) into the colorless C(30) carotenoid 4,4'-diapophytoene (dehydrosqualene). 2 (2E,6E)-farnesyl diphosphate = 15-cis-4,4'-diapophytoene + 2 diphosphate Binds 2 Mg(2+) ions per subunit. Carotenoid biosynthesis; staphyloxanthin biosynthesis; staphyloxanthin from farnesyl diphosphate: step 1/5. Upon coexpression with Rhodobacter geranylgeranyldiphosphate (GGDP) synthase, CrtM produces very small amounts of C(40) phytoene. Belongs to the phytoene/squalene synthase family. CrtM subfamily.