add support for GDAL examples and tests
rearrange CMakeLists.txt lines to give more logical errors