Measurement of D-meson production at mid-rapidity in pp collisions at root s=7 TeV