cmake: added compiler check for scoped enums