I just replied to this on another board so as long as the text is still in my clipboard I'll use it again... (but the quick answer is CJ and YJ are compatible. For TJ, see below)
I have a 2000 TJ with full hard doors and factory hardtop. I also have a 1983 CJ8 with full hard doors and a factory World Cab full hardtop. I have two sets of full doors for the CJ, the original 83 CJ doors and a nicer set of 93 YJ doors.
All three sets of doors have the same dimensions top to bottom and front to back. So at least in terms of rough dimensions, the doors are the same size.
I have a digital angle gauge and checked the angle of the both the TJ and CJ windshields with it. I zeroed the gauge on the horizontal part of the door at the bottom of the window, and then measured the angle of the windshield frame on the door side of the frame. I zeroed the gauge for both vehicles and made the same measurement. In both cases, the angle was within 0.1 degree of 22.5 degrees back from the vertical. So at least in the case my my two Jeeps, the TJ and CJ windshield angles are the same. I have seen many CJ's with goofy windshield angles so your results may be different, but for at least my two Jeeps with the specific factory hardtops I have, the angles are the same. I don't know what angle you'd get with a CJ fiberglass hardtop, I used the metal CJ8 full hardtop for these angle measurements.
I then tried the to swap doors, putting the CJ door on the TJ and the TJ door on the CJ.
Neither door would close, but they weren't far off. Here are the points you'd have to deal with:
1. I believe with adjustment of the positioning of the hinges on the doors you could get either door to fit properly in the opening of the other Jeep. I did not want to loosen and move the hinges on either of my doors because I didn't want to disturb the paint. Mine didn't fit as they were but I saw that if I wanted to loosen the CJ hinges and move the door down a bit it probably would have fit in the TJ. On the CJ it looked like I had to loosen the TJ hinges to let the TJ door angle down a bit in the back. But like I said, I didn't want to move my hinges so I didn't try this. By the way, when I restored the YJ doors to put on the CJ I had to move the hinges also, so I believe each set of doors will have slightly different hinge positioning from the factory (or from years of use) and these have to be adjusted in any case of fitting different doors to at least a CJ. So this probably isn't a big deal or out of the ordinary.
2. The TJ has plastic channels on the inside of the windshield frame, this is where the weatherstripping seals. I think these would have to be adjusted a bit on the TJ in order for CJ doors to fit. Or perhaps they would fit ok if the hinges were adjusted, I couldn't tell.
3. Here's the big one, and possibly a showstopper. The TJ strikers are centered 1 inch lower on the doors than the CJ strikers. So if you were to swap the strikers - if you put CJ strikers on a TJ they would be 1 inch too low to engage properly with CJ doors. If you put TJ strikers on a CJ they would be 1 inch too high to properly engage with the TJ doors. Both of these swaps would require some fabrication and possibly light cutting of the tub to get the strikers to line up. It doesn't look impossible, but it would take a little bit of creative engineering.
I'd love to hear from someone who has actually made this work, in my opinion the only tough part is the vertical position of the strikers, all the rest seems adjustable to me, at least between my TJ and my CJ8.
PS: My Scrambler project site, in case you want to see the hardtop I made these measurements with: