If any party to the action is entitled to an estate of homestead in the premises, or any part thereof, and the homestead has not been set off, the homestead may be set off by the court ; and if the court so directs, the premises so allotted or set off may be partitioned among the claimants, subject thereto.
735 ILCS 5/17-112