<div dir="ltr"><div>Hi,</div><div><br></div><div>Why not in the build instructions of the code repo instead: <a href="https://github.com/qgis/QGIS/blob/master/INSTALL.md" target="_blank">https://github.com/qgis/QGIS/blob/master/INSTALL.md</a>? If it's a working process, easy to replicate, this is the place I'd expect this kind of information.</div><div><br></div><div>Regards,</div><div>Harrissou<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 31 janv. 2021 à 15:55, Jorge Gustavo Rocha <<a href="mailto:jgr@di.uminho.pt" target="_blank">jgr@di.uminho.pt</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Stefan,<br>
<br>
We have now a new tab on github called 'discussions'[1]. Your detailed<br>
instructions are a good candidate to write down a new entry there, under<br>
'Show and tell' category. The goal is to keep this information next to<br>
the repo. You can use the markdown syntax to enhance the writing format.<br>
You can also add some print screens.<br>
<br>
This is just a suggestion. Feel free to put it there or not.<br>
<br>
Regards (and thank you!),<br>
<br>
Jorge Gustavo<br>
<br>
[1] <a href="https://github.com/qgis/QGIS/discussions" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/discussions</a><br>
<br>
Às 14:13 de 31/01/21, Uhrig, Stefan escreveu:<br>
> Install Visual Studio Community 2019: Select "Desktop development with<br>
> C++" under "Workloads" and "C++ MFC for latest v142 build tools (x86 &<br>
> x64)" under "Individual components". Verify that you install "Windows 10<br>
> SDK (10.0.18362.0)" or higher.<br>
> <br>
>  <br>
> <br>
> Install Git for Windows and Python 3.<br>
> <br>
>  <br>
> <br>
> Download<br>
> <a href="https://sourceforge.net/projects/winflexbison/files/win_flex_bison3-latest.zip/download" rel="noreferrer" target="_blank">https://sourceforge.net/projects/winflexbison/files/win_flex_bison3-latest.zip/download</a><br>
> and extract it to a location of your choice (avoid space characters in<br>
> the target path).<br>
> <br>
>  <br>
> <br>
> Follow the vcpkg "Quick Start: Windows" instructions at<br>
> <a href="https://github.com/microsoft/vcpkg#quick-start-windows" rel="noreferrer" target="_blank">https://github.com/microsoft/vcpkg#quick-start-windows</a>. Make sure to<br>
> execute the "vcpkg integrate install" command.<br>
> <br>
>  <br>
> <br>
> Install the required dependencies via:<br>
> <br>
>  <br>
> <br>
> vcpkg --triplet=x64-windows install exiv2 gdal gsl libspatialindex<br>
> libspatialite libzip opencl protobuf qca qscintilla qt5 qt5-serialport<br>
> qt5-location qt5-winextras qtkeychain qwt zstd<br>
> <br>
>  <br>
> <br>
> This may take a while as this creates a Debug and a Release build of<br>
> each dependency from source.<br>
> <br>
>  <br>
> <br>
> Clone the QGIS repostiory. The path to the QGIS repository should not<br>
> contain any space characters.<br>
> <br>
>  <br>
> <br>
> Start Visual Studio and open the QGIS CMakeLists.txt file via "File --><br>
> Open --> CMake...". This will start the CMake generation, which will<br>
> fail. You will need several configuration rounds until everything is<br>
> setup properly.<br>
> <br>
>  <br>
> <br>
> Let's start with a Release build because that requires less tweaking. Go<br>
> to "Project --> CMake Settings". Delete the default configuration<br>
> ("x64-Debug (default)").<br>
> <br>
>  <br>
> <br>
> Add a new "x64-Release" configuration and set "Configuration type" to<br>
> "Release". Save the CMakeSettings.json file, which will start a new<br>
> CMake generation. "FIND_FLEX" will fail, so you need to set the<br>
> "FLEX_EXECUTABLE" path manually in section "CMake variables and cache".<br>
> Browse to your win_flex.exe file. Additionally, disable "WITH_BINDINGS"<br>
> and "WITH_QGIS_PROCESS". Save the file. Next set "BISON_EXECUTABLE" to<br>
> your win_bison.exe file and save again. Disable "WITH_QTWEBKIT" and<br>
> save. Set "QCA_LIBRARY" to<br>
> "<vcpkg-root>\installed\x64-windows\lib\qca.lib" and save. Configuration<br>
> should now succeed, but you have to change "GEOS_LIBRARY" from<br>
> "geos.lib" to "geos_c.lib". Save and start the build after CMake<br>
> generation has finished.<br>
> <br>
>  <br>
> <br>
> Select "qgis.exe (output\bin\qgis.exe)" as start-up item in the toolbar<br>
> and start QGIS.<br>
> <br>
>  <br>
> <br>
> Now let's do the same for a Debug build. Add a "x64-Debug" configuration<br>
> and save. Change to the "x64-Debug" configuration in the toolbar. Repeat<br>
> the steps from above (set flex and bison paths etc.). When selecting<br>
> libraries, take the libraries from<br>
> "<vcpkg-root>\installed\x64-windows\debug\lib". Most libraries will have<br>
> a "d" or "_d" as name suffix. The CMake generation will not always<br>
> select the debug versions of libraries. Hence, go over the CMake<br>
> variables and change release library paths to debug library paths, e.g.<br>
> "<vcpkg-root>\installed\x64-windows\debug\lib\geos_cd.lib" for<br>
> GEOS_LIBRARY. I'll append my CMakeSettings.json file as reference to<br>
> this mail. Save again and start the build.<br>
> <br>
>  <br>
> <br>
> The build will fail because the execution of crssync.exe fails. That's<br>
> because crssync.exe tries to load zstd.dll instead of zstdd.dll. I<br>
> haven't figured out why, yet. An easy workaround is copying zstdd.dll to<br>
> zstd.dll in QGIS\out\build\x64-Debug\output\bin. Then restart the build<br>
> and it should succeed.<br>
> <br>
>  <br>
> <br>
> You should then be able to start and debug qgis.exe and its<br>
> dependencies. Note that some vcpkg portfiles forget to copy over the<br>
> .pdb files. For example, proj is affected. If you find such a library<br>
> with a missing .pdb file, check whether the portfile (e.g.<br>
> "<vcpkg-root>\ports\proj4\portfile.cmake") contains the<br>
> "vcpkg_copy_pdbs()" call. If not, just add it at the end, re-install the<br>
> dependency and copy over the .pdb file to the QGIS output directory.<br>
> <br>
>  <br>
> <br>
> I'm currently trying to get QGIS working with Python bindings. I got the<br>
> build working, however I'm struggling with the debug build execution.<br>
> The debug Python library seems to be unable to load the Release build Qt<br>
> libraries that come with PyQt5. Well, I'll keep trying and if I succeed,<br>
> I'll update the instructions.<br>
> <br>
>  <br>
> <br>
> Here is my CMakeSettings.json file for reference:<br>
> <br>
>  <br>
> <br>
> {<br>
> <br>
>   "configurations": [<br>
> <br>
>     {<br>
> <br>
>       "name": "x64-Release",<br>
> <br>
>       "generator": "Ninja",<br>
> <br>
>       "configurationType": "Release",<br>
> <br>
>       "buildRoot": "${projectDir}\\out\\build\\${name}",<br>
> <br>
>       "installRoot": "${projectDir}\\out\\install\\${name}",<br>
> <br>
>       "cmakeCommandArgs": "",<br>
> <br>
>       "buildCommandArgs": "",<br>
> <br>
>       "ctestCommandArgs": "",<br>
> <br>
>       "inheritEnvironments": [ "msvc_x64_x64" ],<br>
> <br>
>       "variables": [<br>
> <br>
>         {<br>
> <br>
>           "name": "WITH_BINDINGS",<br>
> <br>
>           "value": "False",<br>
> <br>
>           "type": "BOOL"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "WITH_QGIS_PROCESS",<br>
> <br>
>           "value": "False",<br>
> <br>
>           "type": "BOOL"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "FLEX_EXECUTABLE",<br>
> <br>
>           "value": "C:/src/tools/win_flex.exe",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "BISON_EXECUTABLE",<br>
> <br>
>           "value": "C:/src/tools/win_bison.exe",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "WITH_QTWEBKIT",<br>
> <br>
>           "value": "False",<br>
> <br>
>           "type": "BOOL"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "QCA_LIBRARY",<br>
> <br>
>           "value": "C:/src/vcpkg/installed/x64-windows/lib/qca.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "GEOS_LIBRARY",<br>
> <br>
>           "value": "C:/src/vcpkg/installed/x64-windows/lib/geos_c.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         }<br>
> <br>
>       ]<br>
> <br>
>     },<br>
> <br>
>     {<br>
> <br>
>       "name": "x64-Debug",<br>
> <br>
>       "generator": "Ninja",<br>
> <br>
>       "configurationType": "Debug",<br>
> <br>
>       "buildRoot": "${projectDir}\\out\\build\\${name}",<br>
> <br>
>       "installRoot": "${projectDir}\\out\\install\\${name}",<br>
> <br>
>       "cmakeCommandArgs": "",<br>
> <br>
>       "buildCommandArgs": "",<br>
> <br>
>       "ctestCommandArgs": "",<br>
> <br>
>       "inheritEnvironments": [ "msvc_x64_x64" ],<br>
> <br>
>       "variables": [<br>
> <br>
>         {<br>
> <br>
>           "name": "FLEX_EXECUTABLE",<br>
> <br>
>           "value": "C:/src/tools/win_flex.exe",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "BISON_EXECUTABLE",<br>
> <br>
>           "value": "C:/src/tools/win_bison.exe",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "WITH_QTWEBKIT",<br>
> <br>
>           "value": "False",<br>
> <br>
>           "type": "BOOL"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "WITH_BINDINGS",<br>
> <br>
>           "value": "False",<br>
> <br>
>           "type": "BOOL"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "WITH_QGIS_PROCESS",<br>
> <br>
>           "value": "False",<br>
> <br>
>           "type": "BOOL"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "QCA_LIBRARY",<br>
> <br>
>           "value": "C:/src/vcpkg/installed/x64-windows/debug/lib/qcad.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "GEOS_LIBRARY",<br>
> <br>
>           "value":<br>
> "C:/src/vcpkg/installed/x64-windows/debug/lib/geos_cd.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "GSL_LIB",<br>
> <br>
>           "value": "C:/src/vcpkg/installed/x64-windows/debug/lib/gsld.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "GSLCBLAS_LIB",<br>
> <br>
>           "value":<br>
> "C:/src/vcpkg/installed/x64-windows/debug/lib/gslcblasd.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "PROJ_LIBRARY",<br>
> <br>
>           "value":<br>
> "C:/src/vcpkg/installed/x64-windows/debug/lib/proj_d.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "QSCINTILLA_LIBRARY",<br>
> <br>
>           "value":<br>
> "C:/src/vcpkg/installed/x64-windows/debug/lib/qscintilla2_qt5d.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "QTKEYCHAIN_LIBRARY",<br>
> <br>
>           "value":<br>
> "C:/src/vcpkg/installed/x64-windows/debug/lib/qt5keychaind.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "QWT_LIBRARY",<br>
> <br>
>           "value": "C:/src/vcpkg/installed/x64-windows/debug/lib/qwtd.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         },<br>
> <br>
>         {<br>
> <br>
>           "name": "SPATIALINDEX_LIBRARY",<br>
> <br>
>           "value":<br>
> "C:/src/vcpkg/installed/x64-windows/debug/lib/spatialindex-64d.lib",<br>
> <br>
>           "type": "FILEPATH"<br>
> <br>
>         }<br>
> <br>
>       ]<br>
> <br>
>     }<br>
> <br>
>   ]<br>
> <br>
> }<br>
> <br>
>  <br>
> <br>
>  <br>
> <br>
>  <br>
> <br>
>  <br>
> <br>
> *From:*i-s-o <<a href="mailto:46.i.s.o.64@gmail.com" target="_blank">46.i.s.o.64@gmail.com</a>><br>
> *Sent:* Saturday, January 30, 2021 5:58 PM<br>
> *To:* Uhrig, Stefan <<a href="mailto:stefan.uhrig@sap.com" target="_blank">stefan.uhrig@sap.com</a>><br>
> *Cc:* qgis-developer <<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a>><br>
> *Subject:* Re: [QGIS-Developer] Building QGIS with Visual Studio 2019 CE<br>
> and vcpkg<br>
> <br>
>  <br>
> <br>
> I am very interested in trying out your solution. Could you share the<br>
> required steps?<br>
> <br>
>  <br>
> <br>
> Thx.<br>
> <br>
>  <br>
> <br>
> On Fri, Jan 29, 2021, 09:25 Uhrig, Stefan <<a href="mailto:stefan.uhrig@sap.com" target="_blank">stefan.uhrig@sap.com</a><br>
> <mailto:<a href="mailto:stefan.uhrig@sap.com" target="_blank">stefan.uhrig@sap.com</a>>> wrote:<br>
> <br>
>     TL;DR: It is currently possible to build the QGIS core app with<br>
>     Visual Studio 2019 and vcpkg, which makes debugging QGIS<br>
>     dependencies easy.<br>
> <br>
>      <br>
> <br>
>      <br>
> <br>
>     Hi all,<br>
> <br>
>      <br>
> <br>
>     Some time ago I discovered vcpkg<br>
>     (<a href="https://github.com/microsoft/vcpkg" rel="noreferrer" target="_blank">https://github.com/microsoft/vcpkg</a>). vcpkg is a package manager<br>
>     that downloads package source code to your local machine and builds<br>
>     the package locally. Recently, I discovered that vcpkg should be<br>
>     able to provide all dependencies to build at least the QGIS core<br>
>     application. Hence, I gave it a try.<br>
> <br>
>      <br>
> <br>
>     Basically, it worked out of the box. I started with a fresh Windows<br>
>     10 installation, installed Visual Studio 2019 Community Edition,<br>
>     Git, vcpkg, Python 3 and flex and bison for Windows. I fetched all<br>
>     other dependencies via vcpkg. It was not necessary to even touch a<br>
>     single file in the repository. I could just open the main<br>
>     CMakeLists.txt file in Visual Studio and only had to tweak the CMake<br>
>     cache (the CMake find macros that come with QGIS are not aware of<br>
>     vcpkg, so I had to set some paths manually). I had to switch off<br>
>     some extensions though as the required dependencies were not<br>
>     available via vcpkg (WITH_BINDINGS, WITH_QGIS_PROCESS,<br>
>     WITH_QTWEBKIT). The build did not report any errors, I could start<br>
>     the application and it seems to work, but I did some light testing only.<br>
> <br>
>      <br>
> <br>
>     I mainly tried it because I enjoy debugging with Visual Studio more<br>
>     than with gdb (or gdb wrapped in some IDE). In my experience, the<br>
>     performance of the Visual Studio debugger is better and it is more<br>
>     stable, especially in long debug sessions.<br>
> <br>
>      <br>
> <br>
>     I don’t want to promote official building support of QGIS with<br>
>     vcpkg. Providing the dependencies via OSGeo4W is much more reliable.<br>
>     However, if you don’t mind the experimental nature of this setup and<br>
>     you want to be able to debug into QGIS’ dependencies, you might give<br>
>     it a try. Especially, if you want to track the cause of a crash in<br>
>     one of QGIS’ dependencies, this setup might be helpful. You have the<br>
>     source code and debug versions of the dependencies, so the debugger<br>
>     will jump to the crashing code line and you can inspect all the<br>
>     variables of the dependency.<br>
> <br>
>      <br>
> <br>
>     If someone is interested in trying it, give me a note. I can then<br>
>     assemble detailed instructions on how to make it work. It took me a<br>
>     while to figure out which packages are needed and how the CMake<br>
>     cache needs to be tweaked.<br>
> <br>
>      <br>
> <br>
>     Best regards,<br>
> <br>
>     Stefan<br>
> <br>
>      <br>
> <br>
>      <br>
> <br>
>      <br>
> <br>
>     _______________________________________________<br>
>     QGIS-Developer mailing list<br>
>     <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a> <mailto:<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a>><br>
>     List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>     Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> <br>
> <br>
> _______________________________________________<br>
> QGIS-Developer mailing list<br>
> <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> <br>
<br>
J. Gustavo<br>
-- <br>
Jorge Gustavo Rocha<br>
Departamento de Informática<br>
Universidade do Minho<br>
4710-057 Braga<br>
Gabinete 3.29 (Piso 3)<br>
Tel: +351 253604480<br>
Fax: +351 253604471<br>
Móvel: +351 910333888<br>
skype: nabocudnosor<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>