[QGIS-Developer] Compiling against homebuilt GDAL

Even Rouault even.rouault at spatialys.com
Wed Feb 28 10:45:52 PST 2024


Thomas,

Le 28/02/2024 à 19:33, Thomas Larsen Wessel via QGIS-Developer a écrit :
> I have successfully built QGIS and GDAL (3.7.2) separately. Now I want 
> to build QGIS against this GDAL. This is what I tried:
>
> git clone git at github.com:qgis/QGIS.git
> cd QGIS
> mkdir build
> cd build
> GDAL_DIR=/home/velle/gdal3.7.2/build cmake ..
>
> The output contains the following error for GDAL:
>
> CMake Error at /home/velle/gdal-3.7.2/build/GDALConfig.cmake:24 (include):
>   include could not find requested file:
>     /home/velle/gdal-3.7.2/build/GDAL-targets.cmake
> Call Stack (most recent call first):
>   cmake/FindGDAL.cmake:16 (find_package)
>   CMakeLists.txt:365 (find_package)
>
> Could someone please tell me if I'm even doing it right?

You need to *install* GDAL first. You can't just point QGIS to the GDAL 
build directory

So in the GDAL build directory, do "cmake .. 
-DCMAKE_INSTALL_PREFIX=$HOME/install-gdal-3.7.2 ; make -j$(nproc); make 
install"

and then when configuring QGIS, use GDAL_DIR=$HOME/install-gdal-3.7.2 . 
I'm not totally sure about that last part. may require tweaking. you 
could alter the PATH to point to $HOME/install-gdal-3.7.2/bin so that 
"gdal-config" from your installed GDAL is picked up

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/qgis-developer/attachments/20240228/9f63bcd5/attachment.htm>


More information about the QGIS-Developer mailing list