Started in 1764 during the reign of Louis XV, and designed by Constant d'Ivry using plans based on the St-Louis-des-Invalide Church, it was razed by a second architect to who favored a design modeled after the Panthéon. However this second design was not well accepted either, and all work ceased between 1790 and 1806.
Napoléon then decided that a Temple of Glory to his Grande Armée should be built, and Pierre-Alexandre Vignon was commissioned to draw up the plans. After razing the remaining efforts from 1790, building started on what was to be a Greek temple. The commemorative role of the edifice was lost when the Arc de Triomphe was completed in 1808, and again the focus of the structure became ambiguous.
In 1814, Louis XVIII confirmed that the Madeleine should be a church, but in 1837 it was nearly selected to be the first railway station of Paris. Finally in 1842 it was consecrated as a church. (paris.org)