1. A method for determining a source shape, a mask shape and a target shape for a lithography process comprising: receiving source, mask and target constraints; formulating an optimization problem that is based on the source, mask and target constraints and incorporates contour-based assessments for the target shape that are based on physical design quality of a circuit; solving, by a hardware processor, the optimization problem by integrating over process condition variations to simultaneously determine the source shape, the mask shape and the target shape; and outputting the determined source shape and mask shape.