In the UK I've signed a few employment contracts with such clauses, that If I produce something outside of working hours the company still owns it.
I signed the contracts anyway assuming that most likely the company would not be interested in what I created outside working hours (or even know of it) and that they would only get interested if it becamse really successful, in which case I would probably have the means to defend it.