Merged kashif's cmake branch and fixed invalid geometry issue on 32bit OS

I merged kashif's cmake branch and fixed invalid geometry issue on 32bit OS (OSGeo LiveDVD pgRouting workshop .etc).
Please merge my fixes.

Regards,