Source-mask optimization (SMO) is used in advanced computational lithography to further enlarge the process margin. SMO provides the source for subsequent optical proximity correction (OPC) to generate the mask with reasonable manufacturability and functionality. Little attention is paid to the mask optimization procedure of SMO. The procedure may potentially cause significant mismatch between a source-mask optimized mask (SMOed mask) and an optical proximity-corrected mask (OPCed mask), which affects the efficiency of the optimization. We investigate and report a specific example of an efficient method to align the SMOed mask to the OPCed mask so as to reduce the cycles of computational lithography and improve the predictability of SMO. This method incorporates techniques of retargeting and manipulating the cost function (CF) into SMO to modify the CF and eventually change the mask shapes. Various defects can also be corrected to minimize the needed number of hotspots, which also improves the effectiveness of SMO and decreases the cycles of computational lithography. Our sample simulations performed on a metal layer with both diffractive optical element (DOE) and freeform illumination demonstrate that the proposed SMO further enhances the process window (PW) by more than 30% compared with conventional SMO. The optimized mask shape is also more similar to OPCed mask. Experimental verification is also performed to validate the proposed method.