As the Oslandia team work exclusively on GNU/Linux, the exercise of compiling QGIS 3 on Windows 8 is not an everyday’s task :). So we decided to share our experience, we bet that will help some of you.
Cygwin
The first step is to download Cygwin and to install it in the directory C:\cygwin (instead of the default C:\cygwin64). During the installation, select the lynx package:
Once installed, you have to click on the Cygwin64 Terminal icon newly created on your desktop:
Then, we’re able to install dependencies and download some other installers:
CMake
The next step is to install CMake. To do that, double clic on the file cmake-3.7.2-win64-x64.msi previously downloaded with wget. You should choose the next options during the installation:
Visual Studio
Then, we have to install Visual Studio and C++ tools. Double click on the vs_community_ENU.exe file and select the Custom installation. On the next page, you have to select Visual C++ chekbox:
OSGeo4W
In order to compile QGIS, some dependencies provided by the OSGeo4W installer are required. Double click on osgeo4w-setup-x86_64.exe and select the Advanced Install mode. Then, select the next packages:
- expat
- fcgi
- gdal
- grass
- gsl-devel
- iconv
- libzip-devel
- libspatialindex-devel
- pyqt5
- python3-devel
- python3-qscintilla
- python3-nose2
- python3-future
- python3-pyyaml
- python3-mock
- python3-six
- qca-qt5-devel
- qca-qt5-libs
- qscintilla-qt5
- qt5-devel
- qt5-libs-debug
- qtwebkit-qt5-devel
- qtwebkit-qt5-libs-debug
- qwt-devel-qt5
- sip-qt5
- spatialite
- oci
- qtkeychain
QGIS
To start this last step, we have to create a file C:\OSGeo4W\OSGeo4W-dev.bat containing something like:
According to your environment, some variables should probably be adapted. Then in the Cygwin terminal:
In this directory, you have to edit the file package-nightly.cmd to replace:
by:
Moreover, we had to update the environment variable SETUAPI_LIBRARY according to the current position of the Windows Kits file SetupAPI.Lib:
And finally, we just have to compile with the next command:
Victory!
And see you soon for the generation of OSGEO4W packages 😉
Source
https://github.com/qgis/QGIS/blob/ab859c9bdf8a529df9805ff54e7250921a74d877/doc/msvc.t2t