We present pressure (P) and temperature (T ) variations of elastic and anisotropic properties, solid-solid (rocksalt, B1 to cesium chloride, B2) and solid-liquid structural phase transitions of CaO. We employed firstprinciples density functional theory supplemented with an anharmonic contribution to phonon dynamics. Good agreement is obtained for all properties up to the pressure and temperature range relevant to the Earth's mantle and outer core. Born elastic criteria are generalized for arbitrary stress to elaborate the structural phase diagram from a thermoelastic viewpoint. We propose a self-consistent computational scheme to incorporate the effect of thermal hysteresis into Lindemann's melting law. This improvised melting law exhibits quantitative agreement with reported findings for the high-P melting curve. We find the triple point (i.e., the coexistence of B1, B2, and liquid phases) at 23 GPa and 4600 K. By examining the pressure-term included elastic properties, we can show that the solid-solid transition is mechanical in a pressure range of 0-200 GPa and temperature up to 3000 K. The softening of shear elastic constant C44 drives the B1-B2 phase transition. This assertion is corroborated by examining the phonon dispersion curve and mode Gruneisen parameter at different pressures for both B1 and B2 phases. The solid-liquid phase boundary can be treated accurately through the temperature-dependent thermodynamic Gruneisen parameter. Furthermore, in this paper, we predict a negative melting slope >140 GPa with a peak temperature of 7800 K, suggesting a smaller molar volume on the liquid side than that of the solid phase. This finding is supported by electronic band structure calculation. It is proposed that the hybridization of the empty 3d band of the cation with s orbitals lowers the conduction band to cross the Fermi energy at the Brillouin zone center and leads the insulator-to-metal/semimetal phase transition -200 GPa. Different electronic states on solid and liquid sides make the liquid phase more compressible than the solid phase, eventually reducing the melting temperature with pressure.