The production of mesons in proton–proton collisions at is studied with the LHCb detector at the LHC. The differential cross-section for prompt production is measured as a function of the transverse momentum pT and rapidity y in the fiducial region and y∈[2.0;4.5]. The differential cross-section and fraction of from b-hadron decays are also measured in the same pT and y ranges. The analysis is based on a data sample corresponding to an integrated luminosity of 5.2 pb−1. The measured cross-sections integrated over the fiducial region are production and from b-hadron decays, where the first uncertainty is statistical and the second systematic. The prompt production cross-section is obtained assuming no polarisation and the third error indicates the acceptance uncertainty due to this assumption.