The President of the United States is authorized to procure the assent of the legislature of any State, within which any purchase of land has been made for the erection of forts, magazines, arsenals, dockyards, and other needful buildings, without such consent having been obtained.