Added optional parameter in cmake for ANSI, improved slist code