cmake: move macro to match section header
cmake: reduce double .o builds
cmake: detect Lua
cmake: probably fix paths