[CMake] Treat examples as tests, handle subfolder grid.

Our CMake macros are confused by tests located in the module's
root directory.
Some tests fail because they cannot locate the grids subdirectory.