Measurements of the prompt D-meson production in pPb collisions at 5.02 TeV