In this paper we define the analogue of Calabi–Yau geometry for generic D=4, N=2 flux backgrounds in type II supergravity and M‐theory. We show that solutions of the Killing spinor equations are in one‐to‐one correspondence with integrable, globally defined structures in E7(7)×double-struckR+ generalised geometry. Such “exceptional Calabi–Yau” geometries are determined by two generalised objects that parametrise hyper‐ and vector‐multiplet degrees of freedom and generalise conventional complex, symplectic and hyper‐Kähler geometries. The integrability conditions for both hyper‐ and vector‐multiplet structures are given by the vanishing of moment maps for the “generalised diffeomorphism group” of diffeomorphisms combined with gauge transformations. We give a number of explicit examples and discuss the structure of the moduli spaces of solutions. We then extend our construction to D=5 and D=6 flux backgrounds preserving eight supercharges, where similar structures appear, and finally discuss the analogous structures in Ofalse(d,dfalse)×double-struckR+ generalised geometry.