try_compile: Refactor language standard level parsing

cmCoreTryCompile had significant code duplication around handling
languages that offer standard levels. This refactoring reduces
the complexity and makes it easier to add new languages in the
future.
2 files changed