[gdal-dev] About installing EXPAT

Even Rouault even.rouault at spatialys.com
Mon Sep 25 05:29:52 PDT 2023


Abel,

>
> In Cmakefile.txt of the project I’ve configured this (below # 
> Developer may want to specify some variable to find proper version.):
>
> set(EXPAT_INCLUDE_DIR "D:/GitHub-repository/libexpat/expat/lib")
>
> set(EXPAT_LIBRARY 
> "D:/GitHub-repository/libexpat/expat/build/Debug/libexpatd.lib")
>
Is this .lib a static library, or an import library of the .dll ? My 
assumption (I may be wrong) is that it is an import lib of the .dll. In 
which case you must not set EXPAT_USE_STATIC_LIBS
>
> set(EXPAT_LIBRARY 
> "D:/GitHub-repository/libexpat/expat/build/Debug/libexpatd.dll")
>
That won't work. This needs to be a .lib

You'd better run cmake again on expat with a 
-DCMAKE_INSTALL_PREFIX=d:/install-prefix   and run "cmake --build . 
--target install", and then when building GDAL, use "cmake .. 
-DCMAKE_PREFIX_PATH=d:/install-prefix", so it automatically configures 
things from what is found in d:/install-prefix

You could also potentially use vcpkg or conda to install GDAL 
dependencies instead of building them from scratch: 
https://gdal.org/download.html

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230925/b66646be/attachment.htm>


More information about the gdal-dev mailing list