High-precision measurement of the W boson mass at CMS