Cavity-enhanced Absorption Spectroscopy in the Near- and Mid-infrared for Gas Sensing