Capillary condensation theory for adsorption of vapors on mesoporous solids