[cmake] get rid of undefined HAVE_GRIDTYPE warning

This commit gets rid of a warning for me. It is tested with v2.3.1 but it should work on current master as well.
The whitespace change in line 30 is introduced to make the indentation consistent with the rest of this block.

P.S.: I know that this is not your favorite way of getting patches but I hope someone gets notified of this never the less.