Square meal dates to 1868, although it did not become common until around 1880. It is an Americanism. It comes from the adjectival use of square to mean sturdy or substantial. There are older, related senses of the adjective square. In the 17th century, square was used to describe someone who could eat and drink copious amounts.
There are various stories relating this phrase to the types of food (usually four in number) consumed. These stories are not true.
The style of eating, dubbed square meal and once required of plebes at West Point, where eating utensils must be moved at right angles is derivative of the common usage, not the origin.
(Source: Oxford English Dictionary Online)