make it compile on OS X

I've tried compiling some simple filterscripts and it seems to be working just fine.

I'm sorry if I made a mess in the CMake file, I'm not very familiar with it!