refactor cmake files

handle global platform-specifics in separate modules