What Ethan and Fred describe, is the standard method that everybody uses, and is the correct way. There aren't any real tricks beyond that. The only thing that I could suggest that you take a look at is the nut. Make sure that the leading edge is sharp. The edge facing the fretboard is the zero edge in determining the string length, sometimes when they've been setup, they angle the nut slot down towards the headstock to lower the friction for tremolo use. In doing so, they sometimes alter the zero edge. That'll elongate the string length slightly.
The other question is whether you tune by ear, or with a tuner? I only use a tuner to get A 440. The other strings are tuned against the A string by ear. You must check not only the octaves, but 4th, 5th Maj, min thirds between strings as well.
The guitar is an equal tempered instrument. It never plays in tune perfectly. Acoustic guitars are the worst, as they often have a straight bridge, with no compensation. Some have a mildly compensated bridge, but they aren't a whole lot better.
Cheers