In a concentrating photovoltaic (CPV) system, realizing an illumination spot consistent with the photosensitive area of the CPV cell while maintaining high optical performances is a challenging but rewarding issue. For instance, uniform irradiance distribution not only reduces the risk of damage to CPV cells due to the local heat accumulation, but also improves photoelectric conversion efficiency; free chromatic aberration ensures that a wide solar spectrum can be regulated; a high concentration ratio helps reduce the usage of CPV cells, and so on. Here, we propose a method to design a freeform mirror array to concentrate sunlight and generate a square light pattern with uniform irradiance distribution on the photovoltaic cell. Each freeform mirror can produce a uniform illumination pattern on the CPV cell. We demonstrate the effectiveness of the proposed method with several design examples, and a series of factors affecting the optical performance is also analyzed.