cmake: fix build with Lua
cmake: cleanup version handling
cmake: allow for statically linking backends