A generalized prescribing curvature problem