Pope Pius XI
Quadragesimo Anno §52
Quadragesimo Anno: On Reconstruction of the Social Order
52 That ownership is originally acquired both by occupancy of a thing not owned by any one and by labor, or, as is said, by specification, the tradition of all ages as well as the teaching of Our Predecessor Leo clearly testifies. For, whatever some idly say to the contrary, no injury is done to any person when a thing is occupied that is available to all but belongs to no one; however, only that labor which a man performs in his own name and by virtue of which a new form or increase has been given to a thing grants him title to these fruits.
Source: Quadragesimo Anno (Vatican.va)