Cmake build fixes. Turn off enum-compare-as-error (like scons builds). Also, remove -w from release build, as that inhibits the warnings-as-errors settings.