The average voltage of a cathode material in the battery app is calculated using the metal phase as the anode, and it the voltage of a full cell setup. For example, Li cathode voltage is obtained assuming that we are using Li metal as the anode; Mg cathode voltage is for Mg metal anode. Hence it is always a relative value by using the metal anode as the reference.
Details of the method can be found in following papers:
M. K. Aydinol and G. Ceder, First-Principles Prediction of Insertion Potentials in Li–Mn Oxides for Secondary Li Batteries, J. Electrochem. Soc., 1997, 144, 11
M. Aydinol, A. Kohan, G. Ceder, K. Cho and J. Joannopoulos, Ab Initio Study of Lithium Intercalation in Metal Oxides and Metal Dichalcogenides, Phys. Rev. B: Condens. Matter Mater. Phys., 1997, 56, 1354–1365