[gdal-dev] cmake ignores EXPAT_INCLUDE_DIR & EXPAT_LIBRARY

Nik Sands nik at nixanz.com
Thu Jul 7 17:38:12 PDT 2022


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.



More information about the gdal-dev mailing list