We present a method for the optimization of high-order harmonic generation based on wave-front correction of the driving laser beam. The technique exploits wave-front adaptive control by means of a deformable mirror, governed by an optimization procedure.