Calabi-Yau spaces provide well-understood examples of supersymmetric vacua in supergravity. The supersymmetry conditions on such spaces can be rephrased as the existence and integrability of a particular geometric structure. When fluxes are allowed, the conditions are more complicated and the analogue of the geometric structure is not well understood. In this talk, I will review work that defines the analogue of Calabi-Yau geometry for generic $D=4$, $N=2$ supergravity backgrounds. The geometry is characterised by a pair of structures in generalised geometry that interpolate between complex, symplectic and hyper-Kahler geometry. Supersymmetry is then equivalent to integrability of the structures, which appears as moment maps for diffeomorphisms and gauge transformations. I will also discuss the extension AdS backgrounds, where deformations of these geometric structures correspond to exactly marginal deformations of the dual field theories.