[CMAKE] Use new policies for CMP0005 and CMP0018 (#1481)