Sunan Ibn Majah, Book 4, Hadith 5 (Ibn Majah 739)

It was narrated that Anas bin Malik said:

"The Messenger of Allah said: 'The Hour will not begin until the people compete in (building) mosques.'"