fixing cmake

sorry, the last PR had a bug in the cmake. I did not notice because my CMakeCache was old. 
This fixes it.
I've tested it with luarocks install, so safe to merge.