How does one get a stray cat from peeing on one's house?

A friend of mine had this problem. He went to the local pet store and bought a can of (seriously) “NO”. Worked like a charm.
But, geez, 6 or 7 pages on how to KILL marmots and then everyone gets thier panties in a wad about shooting a stray cat with a BB gun.You people have got to stop projecting human values onto your “pets”.