As a widely used localization and sensing technique, radars will play an important role in future wireless networks. However, the wireless channels between the radar and the targets are passively adopted by traditional radars, which limits the performance of target detection. To address this issue, we propose to use the reconfigurable intelligent surface (RIS) to improve the detection accuracy of radar systems due to its capability to customize channel conditions by adjusting its phase shifts, which is referred to as MetaRadar. In such a system, it is challenging to jointly optimize both radar waveforms and RIS phase shifts in order to improve the multi-target detection performance. To tackle this challenge, we design a waveform and phase shift optimization (WPSO) algorithm to effectively solve the multi-target detection problem, and also analyze the performance of the proposed MetaRadar scheme theoretically. Simulation results show that the detection performance of the MetaRadar scheme is significantly better than that of the traditional radar schemes.