Open psharma-gdal opened 1 week ago
This seems like impossible to do. Cf https://github.com/OSGeo/gdal/commit/608ad32404697028d2a91a7bc5fb74648ad39af5#commitcomment-147937952
This seems like impossible to do. Cf 608ad32#commitcomment-147937952
I am build GDAL v3.9.3 with GDAL_USE_GEOS=ON
and linking statically with GEOS. In addition i am using
GEOS_DIR
, GEOS_LIBRARY
and GEOS_INCLUDE_DIR
flags.
I am getting linker errors which are resolved only when both geos_c.lib and geos.lib are added to linker inputs in the Visual Studio solutions generated.
However the CMAKE variable GEOS_LIBRARY
isn't allowing to specify both the above geos libs. If i add both then semi-colon gets converted to %3B.
Are there any suggestions by which i could add both the geos libs to the linker input flags on GDAL project?
Using CMake config files rather than old school xxxx_LIBRARY is the way to go. You could also use the GDAL vcpkg builds which have various tunings to allow static linking: https://gdal.org/en/latest/download.html#vcpkg , https://github.com/microsoft/vcpkg/tree/master/ports/gdal
What is the bug?
Refer to https://github.com/OSGeo/gdal/issues/5272
It seems that above issue was fixed and GEOS_LIBRARY was made to accept multiple libraries separated by semi-colon or colon . For e.g.
GEOS_LIBRARY=D:\GEOS\lib\geos.lib;D:\GEOS\lib\geos_c.lib
as CMake parameterHowever while trying to build the latest release v3.9.3 i realize that its not working. The Windows CMAKE solution generated converts the ; into %3B and hence the build fails.
Steps to reproduce the issue
Try passing multiple geos libs as follows
<arg value="-DGEOS_LIBRARY=${unpack.dir}/geos/lib/geos.lib;${unpack.dir}/geos/lib/geos_c.lib" />
The windows solution generated has ; converted to %3B. I even tried below but same result
<arg value="-DGEOS_LIBRARY="${unpack.dir}/geos/lib/geos.lib;${unpack.dir}/geos/lib/geos_c.lib"" />
Versions and provenance
Windows 11, Microsoft Visual studio 2022, CMake
Additional context
No response