@@ -68,7 +68,10 @@ To avoid built objects being owned by root, it may be desirable to add ``-u $(id
6868Building on Windows with Conda dependencies and Visual Studio
6969--------------------------------------------------------------------------------
7070
71- It is less appropriate for Debug builds of GDAL, than other methods, such as using vcpkg.
71+ This approach is less appropriate for Debug builds of GDAL, than other methods, such as using vcpkg.
72+
73+ A minimal Windows build configuration utilizing Conda is provided within the GitHub Actions workflow
74+ defined in :source_file: .github/workflows/cmake_builds.yml - see the ``build-windows-conda `` job.
7275
7376Install git
7477+++++++++++
@@ -90,60 +93,63 @@ Only the latest Community Edition (2022) is available.
9093Install GDAL dependencies
9194+++++++++++++++++++++++++
9295
93- Start a Conda enabled console and assuming there is a c:\\ dev directory
96+ Start a Conda- enabled PowerShell console and assuming there is a `` c:\\dev `` directory
9497
95- .. code-block :: console
98+ .. code-block :: ps1
9699
97100 cd c:\dev
98- conda create --name gdal
101+ conda create -- yes -- name gdal
99102 conda activate gdal
100- conda install --yes --quiet curl libiconv icu git python swig numpy pytest zlib
101- conda install --yes --quiet -c conda-forge compilers clcache
102- conda install --yes --quiet -c conda-forge \
103- cmake proj geos hdf4 hdf5 \
104- libnetcdf openjpeg poppler libtiff libpng xerces-c expat libxml2 kealib json-c \
105- cfitsio freexl geotiff jpeg libpq libspatialite libwebp-base pcre postgresql \
106- sqlite tiledb zstd charls cryptopp cgal librttopo libkml openssl xz
103+ conda install -- yes -- quiet - c conda- forge compilers cmake curl libiconv icu python swig numpy `
104+ pytest pytest- env pytest- benchmark filelock zlib lxml jsonschema setuptools
105+ # --only-deps only installs the dependencies of the listed packages, not the packages themselves
106+ conda install -- yes -- quiet - c conda- forge -- only- deps `
107+ libgdal libgdal- hdf4 libgdal- hdf5 libgdal- netcdf libgdal- pdf libgdal- jp2openjpeg
107108
108109 .. note ::
109110
110- The ``compilers `` package will install ``vs2019_win -64 `` (at time of writing)
111- to set the appropriate environment for cmake to pick up. It also finds and works
112- with Visual Studio 2022 if that is installed.
111+ The ``compilers `` package will install ``vs2022_win -64 `` (at time of writing)
112+ to set the appropriate environment for CMake to pick up. It also finds and works
113+ with Visual Studio 2022 (Professional or Enterprise) if that is installed.
113114
114115Checkout GDAL sources
115116+++++++++++++++++++++
116117
117- .. code-block :: console
118+ .. code-block :: ps1
118119
119120 cd c:\dev
120121 git clone https:// github.com / OSGeo/ gdal.git
121122
122123 Build GDAL
123124++++++++++
124125
125- From a Conda enabled console
126+ From a Conda- enabled PowerShell console:
126127
127- .. code-block :: console
128+ .. code-block :: ps1
128129
129130 conda activate gdal
130131 cd c:\dev\gdal
131- cmake -S . -B build -DCMAKE_PREFIX_PATH:FILEPATH="%CONDA_PREFIX%" \
132- -DCMAKE_C_COMPILER_LAUNCHER=clcache
133- -DCMAKE_CXX_COMPILER_LAUNCHER=clcache
132+ cmake - S . - B build - DCMAKE_PREFIX_PATH:FILEPATH= " $env: CONDA_PREFIX "
134133 cmake -- build build -- config Release - j 8
135134
136- .. only :: FIXME
137-
138- Run GDAL tests
139- ++++++++++++++
135+ Run GDAL tests
136+ ++++++++++++++
140137
141- ::
138+ Check everything has built correctly, and then run the test suite using
139+ the commands below from a Conda-enabled PowerShell console:
142140
143- cd c:\dev\GDAL
144- cd _build.vs2019
145- ctest -V --build-config Release
141+ .. code-block :: ps1
146142
143+ cd c:\dev\gdal\build
144+ # set environment variables, see section below
145+ ..\scripts\setdevenv.ps1
146+ # check the version
147+ gdal -- version
148+ # check the Python module and version
149+ python - c " import osgeo; import inspect; print(inspect.getfile(osgeo))"
150+ python - c " from osgeo import gdal; print(gdal.__version__)"
151+ # run the test suite
152+ ctest - V -- build-config Release
147153
148154 .. _setting_dev_environment_variables :
149155
@@ -180,7 +186,7 @@ To verify that environment variables have been set correctly, you can check the
180186.. code-block :: bash
181187
182188 gdalinfo --version
183- # GDAL 3.11 .0dev-c4a2e0b926-dirty , released 2025/04/10
189+ # GDAL 3.13 .0dev-8c3cf3de02 , released 2025/11/14
184190
185191 and the Python bindings:
186192
0 commit comments