Most folks are talking about from the wall to the front of the speaker, although is is as simple to measure from the wall to the rear of the speaker an add to that the depth of the speaker. Some times it is just simpler to do that, physically speaking.
BTW, this distance is not a constant number for any particular speaker. The distance is determined by the speaker design, the room design, the listening chair position, ad infinitum, so if you have a sloping speaker don't be concerned whether your measuring from the base or the top. It works when your ears tell you you've got it dialed in. FWIW, although you didn't ask, the same applies to side walls, except for a speaker with a wide baffle it is more important to consider the distance from the tweeter and mid-range drivers as they are responsible for most of the first reflections from the side wall. Once again the distance is determined by ear not any formula.
If you are concerned with getting the best bass it is helpful to have a SPL meter and a test disc. Mids and highs are a different issue and are best tuned by ear.