CMake: Filch some local system config vars from cmake-rdb branch, and misc cleanup.