Light selected materials only

I need to use a light (in Cycles) to light selected materials only -the rest of the scene will be lighted with different sources -how can this be done?

Light groups only work with Blender Internal, but you can do it if you render with diffuse/glossy passes and material index, that you can use as mask. And if you want to separate lights, you should make several render layers, then add them back in compositing (lighting is additive).

Thanks, I’ll try that.