Build the cabinet with a flush outside corner. Anything less is....
Make the cabinet as tall as the ceiling height will allow for it to be able to stand up. Hide the difference at the ceiling by any means necessary to please your eye. If that means crown and it is not enough to cover gap, then use a sub detail under the crown. Of course there are plenty of other options at the ceiling if crown is not your flavor.
Go to michaelgrafarchitect.com to see a couple examples.