[gdal-dev] cmake ignores EXPAT_INCLUDE_DIR & EXPAT_LIBRARY

Gaige B. Paulsen osgeo at gbp.gaige.net
Fri Jul 8 03:59:11 PDT 2022


Nik,

Which symbols is the linker complaining about? I build regularly for iOS 
(although not using CMake directly), linking with the system copy of 
libxpat and libxml2 and I haven’t noticed any link or operational 
failures in 3.5.0. Admittedly, I use a subset of the drivers, but if you 
can send the linker errors, I can check to see why I'm not having the 
problem you are, maybe it'll give us a clue.

Cheers,
-Gaige


On 2022-07-07 20:38, Nik Sands wrote:
> Hi GDAL devs,
> 
> I’ve built GDAL 3.5 for iOS (device and simulator) but I’ve found that
> when incorporating libgdal into my iOS app, there are several errors
> related to undefined symbols, all of which are XML related.
> 
> My guess is that the libexpat included in Apple’s SDK is missing some
> symbols that GDAL requires, therefore I’ve now built my own libexpat.
> 
> Now I’m attempting to rebuild GDAL using my own libexpat, using the
> cmake configuration command:
> 
> ==========
> cmake -DCMAKE_TOOLCHAIN_FILE=$CMTOOLCHAIN \
> 	-DPLATFORM=$OS \
> 	-DENABLE_BITCODE=OFF \
> 	-DCMAKE_INSTALL_PREFIX=$PREFIX \
> 	-DBUILD_APPS=OFF \
> 	-DBUILD_SHARED_LIBS=OFF \
> 	-DBUILD_PYTHON_BINDINGS=OFF \
> 	-DPROJ_ROOT=$PREFIX \
> 	-DEXPAT_INCLUDE_DIR=$PREFIX/include \
> 	-DEXPAT_LIBRARY=$PREFIX/lib/libexpat.dylib \
> 	-DSQLITE3_INCLUDE_DIR=$PREFIX/include \
> 	-DSQLITE3_LIBRARY=$PREFIX/lib/libsqlite3.a \
> 	-DIconv_INCLUDE_DIR=$SDKPATH/usr \
> 	-DIconv_LIBRARY=$SDKPATH/usr/lib/libiconv.tbd \
> 	-DCMAKE_BUILD_TYPE=Release \
> 	..
> ==========
> 
> However, when this completes, it tells me that it has ignored the two
> libexpat arguments that I supplied to it:
> 
> ==========
> -- Configuring done
> -- Generating done
> CMake Warning:
>   Manually-specified variables were not used by the project:
> 
>     EXPAT_INCLUDE_DIR
>     EXPAT_LIBRARY
> 
> 
> -- Build files have been written to: ...
> ==========
> 
> Why would it be ignoring these arguments and how can I get it to use
> my own libexpat instead of the default SDK libexpat?
> 
> Cheers,
> Nik.
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list