How can face of cornice be extruded along a given profile 'P' ?
I've used knife tool to cut the long profile at 45 degrees and the assemble them together but process is long?
Try using a curve as a bevel object.
1- Create a curve with the shape you want to use as bevel.
2- Create a different curve as a new object for the shape you want that bevel object to follow
3- With the newly created curve selected, go to the curve menu and select the curve you want to use as bevel object and adjust the bevel depth.