QGIS – 2019 Visual Studio Windows 10 Build

qgis

I've had some success getting QGIS to build with VS2015 following a slightly modified version of the instructions located here:
https://github.com/qgis/QGIS/blob/master/INSTALL.md#41-building-with-microsoft-visual-studio
However this was reliant on me installing VS2015, using some slightly older OSGeo4W dependencies and switching to the QGIS 3.16 release branch on git.

What I'm now trying to do is bring everything up-to-date and build on VS2019. This is where I get to:

  1. I've installed Cmake
  2. I've installed Flex, Bison and git with cygwin
  3. Using the network installer at this link, I installed all of the "qgis-dev-deps" using http://download.osgeo.org as the download site
  4. I modified msvc-env.bat, configonly.bat and package-nightly.bat (all located here in the repo: Qgis/ms-windows/osgeo4w/) to bring them in line with a 2019 installation.

On running my modified configonly.bat, I get the following errors from Cmake:

enter image description here

Essentially cmake is battling to find a few headers files associated with the gdal and proj libraries. These header files don't exist in the directory, so I see why the error is generated. In fact there are no directories under C:\OsGeo4W\apps\ corresponding to gdal and proj at all. However I HAVE installed the gdal and proj development libraries via the network installer I describe in point 3 above. So I'm not sure what the reason for this is. Are there some scripts I need to have run that autogenerate some of that code? Or have I not installed the right packages? Should the cmake scripts be changed?

Best Answer

The build recipes for OSGeo4W v2 (ie. everything except GRASS built with VS2019) are on https://github.com/jef-n/OSGeo4W.

The QGIS repo still has the recipes for OSGeo4W v1 - which are only still used to build the old LTR release on old OSGeo4W. master and release-3_22 still have the old recipes, although they are not used anymore as some of the dependencies in old OSGeo4W grew too old.

https://github.com/jef-n/OSGeo4W/tree/workflows even has a github workflow that creates a master package - so it has the full process. Although that's wip and not currently used to make actual packages.

Related Question