If you make sure your openings are square - take the measurements very carefully and make your doors The exact size of the hole and gradually make them fit properly. You need to be patient to do it right and I'm sure others will chime in to give you a different method - and we may all be correct - choose which method works best for you.
I say make the door to fit the opening to make sure all your measurements (opening and doors) are square. Once I get my doors to fit tightly, I start shaving them down 1/8 of an inch at a time and try fitting the door after every correction. I like to use Popsicle or craft sticks and when I can fit a stick on the bottom, top, and both sides, between the door and casing, I'm almost home. Your goal should be 3/16 on all 4 sides and the batch of craft sticks I bought are 1/8 inch thick. My last step is to fit 2 layers of veneer on top of the sticks and I have my 3/16th inch clearance on all sides. Some folks will use the same method but substitute a US mint quarter. Others will use a whole different approach.
That being said - I'm not a pro at this stuff. I have never sold anything I've made. I took an early retirement 4 years ago and I've made lots of things and given it all away - but folks admire my work and my method works for me.