The inclusive production cross sections of the charmed mesons D^0, D^+, D_s^+ and D^{*+} have been measured in interactions of 920 GeV protons on C, Ti, and W targets with the HERA-B detector at the HERA storage ring. Differential cross sections as a function of transverse momentum and Feynmans x variable are given for the central rapidity region and for transverse momenta up to $pT=3.5$ GeV/$c$. The atomic mass number dependence and the leading to non-leading particle production asymmetries are presented as well.