[cmake] define GRIDTYPE and GRIDDIM unconditionally