Whilst it's often possible to look at all the chords in a song and determine what the key is, it doesn't always work. And going through modes isn't much help, either.
There are so many questions in similar vein that it would appear there's some sort of 'rule' being taught that says 'chords must only belong to a song if their notes are diatonic to that key'. Sorry, it just doesn't work that way.
True, in the majority of songs, the majority of the chords are diatonic, but it's certainly not 'breaking the rules' (what rules??) to include other chords/ntes.
The simple way to find a key is to listen to where the song feels at rest, where it's 'come home', where it could finish, and feel ended. That chord will generally speaking be the key chord. Not 100%, but broadly, a good 99%.
The main reasons other chords are used are secondary dominants, modulations and borrowing chords. Those excuses excuse just about all 'foreign' chords in songs!
Out of the 4 chords, G, C and Cm all legitimately emanate from key G. The B chord could be a seconday dominant, in fact, will be, except as V/vi it usually leads to Em, but here, it goes straight to C - which after all, is only one note different in make up from Em.