Analytical expressions for the magnetoelastic anisotropy constants of cubic magnetic systems are derived for rectangular and oblique distortions originating from epitaxial growth on substrates with lower crystal symmetry. In particular, the temperature variation of the magnetic properties of magnetic films grown on barium titanate (BaTiO3) substrates are explained in terms of strain-induced magnetic anisotropies caused by the temperature dependent phase transitions of BaTiO3. Our results quantify the experimental observations in ferromagnet/bto-based structures, which have been proposed as templates for magnetoelectric composite heterostructures.