Edwards' measures: A thermodynamic construction for dense granular media and glasses