I am fostering a cat for a few weeks now and managed to get my dogs to leave the cat along by having them leave the room when they seem to be looking for the cat; It doesn't work very well with highly energetic dogs. It takes a lot of work so you might have to give yourself a break by using a crate or restraining method. Dogs only listen to confidence, so you can't let yourself get frustrated.
I'm guessing you are referring to cats that are not I your home in which case; since its a hard impulse to stop,
Depending on the intensity or intent you would want to do the same thing you would do to make him listen to you if it was another dog that he is "not keeping his cool around".
In order to the dog to listen to you will need to bring your emphasis to the same level of enthusiasm as the dog has towards the cat. (To do this you have to put your feelings aside and be completely in control when correcting him or he will ignore you) Get his attention then immediately follow up with a correction.
Don't be discouraged if it doesn't work at first. Again, depending on if its a cat at home or a strange cat it might take days or years.
I have two cats and two dogs and they get a long really well. I know from experience it helps if you bring a kitten into a home instead of a full grown cat. When I brought a kitten into me dog's life it seemed to help because he was more curious about her than anything and this gave them time to get to know each other and grow a bond.