Mean-field theory is applied to describe the condensation of dilute interacting Bose gases in general power-law potentials. We investigate the behaviour of the critical temperature and derive an analytical approximation which is second order in the atomic scattering length. This result, on the one hand, provides a comparison tool for further, more elaborate, approaches. On the other hand, it also yields qualitative insights into the crossover between homogeneous and inhomogeneous potentials, where different physical mechanisms govern the behaviour of the critical temperature. The connection of the results to previous studies is worked out.