Move warnings and errors setting to cmake submodule.