Encoding Gaussian curvature in glassy and elastomeric liquid crystal solids