Portability

Modify for different lua and cmake versions.