Fix typos
Add variable-setting code to top-level CMakeLists