When I worked in a garden centre we sold a plant which was supposed to discourage them, Puss Off I think it was.
Last week I fixed very flimsy trellis along the top of a friend's fence. This had worked at another house as it didn't give them a firm hold to climb over.