The court shall determine any adverse claims in respect to any portion of the land involved which it may be necessary to determine for a complete settlement of the boundary lines and the marking thereof and may order a survey to be made by a competent surveyor of such boundary lines between such lands.
SDCL 21-40-5