[Qgis-developer] Patch for compiling qgis-0.8pre2 with
geos-3.0.0rc3
Mike Leahy
mgleahy at alumni.uwaterloo.ca
Sat Dec 16 06:55:03 EST 2006
Ok, that method seems to work well. Here's yet another patch in which I
applied your approach. I generated it from revision 6268 of the the
qgis_unstable branch. With these changes, it compiled and ran for me
with both geos 2.2.3 and geos 3.0.0rc3. I'm not sure if it's perfectly
clean (e.g., I'm not fully sure which geos *.h files really need to be
included in the *.cpp and/or *.h files for things like qgsgeometry and
qgsogrprovider), but what's in the patch seems to be working with no
trouble.
Regards,
Mike
Tom Elwertowski wrote:
> Mike Leahy wrote:
>> Gary Sherman wrote:Ok, that seems to work. Here's yet another patch, that
Tom Elwertowski wrote:
> Mike Leahy wrote:
>> Gary Sherman wrote:
>>> Does this mean that it will also compile with GEOS 2.x?
>>
>> Sorry, it is 3.x only. With my very limited understanding of c++
>> programming, I can only guess if it's even possible to allow compiling
>> against both 2.x and 3.x.
>
> The following seems to be a method for compiling QGIS using either GEOS
> 2 or 3.
>
> 1. Do not change any includes; retain "#include <geos.h>"
>
> 2. After the include of geos.h in qgsgeometry.h and qgsogrprovider.h, add:
>
> #if GEOS_VERSION_MAJOR < 3
> #define GEOS_GEOM geos
> #define GEOS_IO geos
> #define GEOS_UTIL geos
> #else
> #define GEOS_GEOM geos::geom
> #define GEOS_IO geos::io
> #define GEOS_UTIL geos::util
> #endif
>
> 3. Change all "geos::" in cpp files to the appropriate "GEOS_WHATEVER::"
>
> 4. Add "#if GEOS_VERSION_MAJOR < 3" code variations for any renamed
> methods.
>
> I have tried this only for the ogr directory so far. I found one renamed
> method. It compiles for both GEOS 2 and 3.
>
> The work now is to find the new prefix for each of the geos prefixes in
> core.
>
> Tom
>
>>> Does this mean that it will also compile with GEOS 2.x?
>>
>> Sorry, it is 3.x only. With my very limited understanding of c++
>> programming, I can only guess if it's even possible to allow compiling
>> against both 2.x and 3.x.
>
> The following seems to be a method for compiling QGIS using either GEOS
> 2 or 3.
>
> 1. Do not change any includes; retain "#include <geos.h>"
>
> 2. After the include of geos.h in qgsgeometry.h and qgsogrprovider.h, add:
>
> #if GEOS_VERSION_MAJOR < 3
> #define GEOS_GEOM geos
> #define GEOS_IO geos
> #define GEOS_UTIL geos
> #else
> #define GEOS_GEOM geos::geom
> #define GEOS_IO geos::io
> #define GEOS_UTIL geos::util
> #endif
>
> 3. Change all "geos::" in cpp files to the appropriate "GEOS_WHATEVER::"
>
> 4. Add "#if GEOS_VERSION_MAJOR < 3" code variations for any renamed
> methods.
>
> I have tried this only for the ogr directory so far. I found one renamed
> method. It compiles for both GEOS 2 and 3.
>
> The work now is to find the new prefix for each of the geos prefixes in
> core.
>
> Tom
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qgis-unstable-rev6268-geos-2andup.patch
Type: text/x-patch
Size: 24026 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20061216/76f9d808/qgis-unstable-rev6268-geos-2andup.bin
More information about the Qgis-developer
mailing list