[cmake] updated GridUtils to do something useful

Can now be used in the pure cmake as well as in the autotools/cmake
situation. In the end GRIDDIM and GRIDTYPE are define as cached variables.