Despite the highest industrial maturity among additive manufacturing processes, laser-based powder bed fusion of metals (PBF-LB/M) lacks the productivity to further establish as an industrial manufacturing process. One approach for adjusting the melt pool shape to increase productivity in PBF-LB/M is spatial beam shaping. The freedom of beam shaping is almost unlimited, owing to modern optical concepts. The key is a beam shape optimized for a specific target. In this publication, the target is a brick-like melt pool cross-section. The publication demonstrates how the corresponding laser beam shape is designed using numerical optimization. The computed beam shape is reproduced using reflective spatial light phase modulators. The calculation is validated based on single-track experiments. Applying the optimized beam shape results in a melt pool shape similar to the optimization target. The width and depth of the melt track produced deviate by a maximum of 7 % from the specified target values.