<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hello Stefan.</p>
<p>in my local repo I updated libspatialindex\portfile.cmake to 1.9.3 by</p>
<p>vcpkg_from_github(<br />    OUT_SOURCE_PATH SOURCE_PATH<br />    REPO libspatialindex/libspatialindex<br />    REF 1.9.3<br />    SHA512 d4c608abbd631dc163b7b4fb6bf09dee3e85ce692a5f8875d51f05a26e09c75cd17dff1ed9d2c232a071f0f5864d21d877b4cbc252f3416896db24dfa3fa18cb<br />    HEAD_REF master<br />)</p>
<p>and removed the older patchfile.</p>
<p>However, in the end I had to give up, because MSVC did not compile Exiv2 with C++17.</p>
<p>Best regards,</p>
<p>Benjamin</p>
<p><br /></p>
<p id="reply-intro">On 2021-03-01 16:35, Uhrig, Stefan wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<style type="text/css">@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}

#replybody1 p.v1MsoNormal, #replybody1 li.v1MsoNormal, #replybody1 div.v1MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
#replybody1 a:link, #replybody1 span.v1MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
#replybody1 p.v1v1msonormal, #replybody1 li.v1v1msonormal, #replybody1 div.v1v1msonormal
        {mso-style-name:v1msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
#replybody1 .v1MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 56.7pt 70.85pt;}
#replybody1 div.v1WordSection1
        {}</style>
<div lang="DE" style="word-wrap: break-word;">
<div class="v1WordSection1">
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">Hi Benjamin,</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">Thanks for the feedback.</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">AFAIK, QGIS has only recently be bumped to C++17, and the version of spatialindex in vcpkg is still 1.9.0. The fix for the binary_function issue made it to a later version only. So, the bad news is that the build with vcpkg is broken for now.</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">I've read Mathias Kuhn's mail, and his idea of having a curated vcpkg fork seems the best approach to me to solve these kind of issues. On the one hand, we can prevent changes in upstream from breaking the build. On the other hand, we can update dependencies on our own (like the spatialindex library), merge it to the fork and then open a pull request to upstream. We would not be blocked by the upstream review process that way.</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">I'll fork vcpkg and I'll try to update the spatialindex library. If I succeed, I'll mail you the link to the repository.</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">Best regards,</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;">Stefan</span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<p class="v1MsoNormal"><span style="mso-fareast-language: EN-US;"> </span></p>
<div>
<div style="border: none; border-top: solid #E1E1E1 1.0pt; padding: 3.0pt 0in 0in 0in;">
<p class="v1MsoNormal"><strong><span>From:</span></strong><span> Benjamin Jakimow <benjamin.jakimow@geo.hu-berlin.de> <br /><strong>Sent:</strong> Sunday, February 28, 2021 9:03 AM<br /><strong>To:</strong> Mats Taraldsvik <mats.taraldsvik@gmail.com><br /><strong>Cc:</strong> Uhrig, Stefan <stefan.uhrig@sap.com>; qgis-developer <qgis-developer@lists.osgeo.org><br /><strong>Subject:</strong> Re: [QGIS-Developer] Building QGIS with Visual Studio 2019 CE and vcpkg</span></p>
</div>
</div>
<p class="v1MsoNormal"> </p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Hi Stefan,</span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">thanks for your extensive description. So far it worked out very well to setup VS, and I can confirm that geos_c.lib is detected automatically.</span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Unfortunately my build failed, because MovingRegion.h (which comes with vcpkg) wants to use std::binary_function, which was removed with C++17:</span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"><vcpkg root>\installed\x64-windows\include\spatialindex\MovingRegion.h(155): error C2039: 'binary_function': is not a member of 'std'</span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">I wonder why, because this issue has been solved in libspatialindex since Oct 2019 (<a href="https://github.com/libspatialindex/libspatialindex/pull/153" target="_blank" rel="noopener noreferrer">https://github.com/libspatialindex/libspatialindex/pull/153</a>)</span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Best regards, <br />Benjamin</span></p>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p id="v1reply-intro"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">On 2021-02-11 11:29, Mats Taraldsvik wrote:</span></p>
<blockquote style="border: none; border-left: solid #1010FF 1.5pt; padding: 0in 0in 0in 5.0pt; margin-left: 0in; margin-right: 0in;">
<div id="v1replybody1">
<div>
<div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Hi Stefan,</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Thank you for this excellent guide to compile with vcpkg, it worked right away after me struggling with the official guide+CMake compilation for a couple of hours.</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">I did make a few modifications that might help:</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">1. Release build:</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">- geos_c.lib was detected automatically, and for some reason I did not need to explicitly set GEOS_LIBRARY</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">2. Debug build:</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">I noticed: 1> [CMake] -- Found ZSTD: C:/Users/mattar/Source/Repos/vcpkg_qgis/installed/x64-windows/lib/zstd.lib in the logs and you wrote:</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">> The build will fail because the execution of crssync.exe fails. That's because crssync.exe tries to load zstd.dll instead of zstdd.dll. I haven't figured out why, yet. An easy workaround is copying zstdd.dll to zstd.dll in QGIS\out\build\x64-Debug\output\bin. Then restart the build and it should succeed.</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">By setting ZSTD_LIBRARY explicitly to <your-vcpkg-root>/installed/x64-windows/debug/lib/zstdd.lib it picked the right lib and dll:</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Then log changed to: 1> [CMake] -- Found ZSTD: C:/Users/mattar/Source/Repos/vcpkg_qgis/installed/x64-windows/debug/lib/zstdd.lib</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">I hope this does help a bit.</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">I'm an outsider to this community, but my humble suggestion _when this work is complete_ (what's missing except for python support?):</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">- add your CMakeSettings.json to the build description or to src/CMakeSettings.json</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">- vcpkg has a new feature "manifests", where a file vcpkg.json describes all dependencies. this should also be added or described (instead of the vcpkg install command).</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">- vcpkg just got versioning, which might help align the requirements with the rest of qgis</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">- I see that vcpkg already has flex and bison (<your-vcpkg-root>/downloads/tools/winflexbison), so if there is a way for win_bison.exe and win_flex.exe to be copied to the build directory, these could be used instead of cygwin, making the build even easier)</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">- vcpkg does have binary caching, perhaps making a github actions CI build using this method feasible?</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Anyway, thank you for your efforts! It made the first QGIS-step more pleasant. :)</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Best regards,</span></p>
</div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Mats Taraldsvik</span></p>
</div>
</div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<div>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">On Mon, Feb 1, 2021 at 4:24 PM Uhrig, Stefan <<a href="mailto:stefan.uhrig@sap.com" rel="noreferrer">stefan.uhrig@sap.com</a>> wrote:</span></p>
</div>
<blockquote style="border: none; border-left: solid #CCCCCC 1.0pt; padding: 0in 0in 0in 6.0pt; margin-left: 4.8pt; margin-right: 0in;">
<div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Hi all,</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">In my opinion, the build with Visual Studio 2019 and vcpkg is still too experimental to add it to the INSTALL.md file. It might break any day if QGIS requires a package or package version that is not available from vcpkg.</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Actually, I like the idea to add it to the "Show & tell" category. We can ask the community for their experiences with that setup. Does it work, is it getting used? If it is used by some "critical mass" and works over a longer time without issues, we can add instructions to the INSTALL.md file. Maybe we can add a hint to the INSTALL.md file that the not so faint-hearted developers might give it a try and provide a link to the "Show & tell" post.</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">However, to be really useful, the debug build should also work with Python bindings and QGIS processing. I got it working for release builds (just needed to install the required Python dependencies via pip install <package>), but that does not work for debug builds. Someone solved that some years ago in another context (<a href="https://www.riverbankcomputing.com/pipermail/pyqt/2012-April/031385.html" target="_blank" rel="noopener noreferrer">https://www.riverbankcomputing.com/pipermail/pyqt/2012-April/031385.html</a>), so I might get it working. I'll give it a try.</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Furthermore, I'd like to investigate the zstd.dll vs zstdd.dll load issue before publishing the build instructions.</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Best regards,</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Stefan</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<p class="v1v1msonormal"><strong><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">From:</span></strong><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> QGIS-Developer <<a href="mailto:qgis-developer-bounces@lists.osgeo.org" rel="noreferrer">qgis-developer-bounces@lists.osgeo.org</a>> <strong><span style="font-family: 'Verdana',sans-serif;">On Behalf Of </span></strong>DelazJ<br /><strong><span style="font-family: 'Verdana',sans-serif;">Sent:</span></strong> Monday, February 1, 2021 10:49 AM<br /><strong><span style="font-family: 'Verdana',sans-serif;">To:</span></strong> Jorge Gustavo Rocha <<a href="mailto:jgr@di.uminho.pt" rel="noreferrer">jgr@di.uminho.pt</a>><br /><strong><span style="font-family: 'Verdana',sans-serif;">Cc:</span></strong> qgis-developer <<a href="mailto:qgis-developer@lists.osgeo.org" rel="noreferrer">qgis-developer@lists.osgeo.org</a>><br /><strong><span style="font-family: 'Verdana',sans-serif;">Subject:</span></strong> Re: [QGIS-Developer] Building QGIS with Visual Studio 2019 CE and vcpkg</span></p>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Hi,</span></p>
</div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Why not in the build instructions of the code repo instead: <a href="https://github.com/qgis/QGIS/blob/master/INSTALL.md" target="_blank" rel="noopener noreferrer">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.</span></p>
</div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
</div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Regards,</span></p>
</div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Harrissou</span></p>
</div>
</div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<div>
<div>
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">Le dim. 31 janv. 2021 à 15:55, Jorge Gustavo Rocha <<a href="mailto:jgr@di.uminho.pt" rel="noreferrer">jgr@di.uminho.pt</a>> a écrit :</span></p>
</div>
<blockquote style="border: none; border-left: solid windowtext 1.0pt; padding: 0in 0in 0in 6.0pt; border-color: currentcolor currentcolor currentcolor #cccccc; margin: 5.0pt 0in 5.0pt 4.8pt;">
<p class="v1v1msonormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">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" target="_blank" rel="noopener noreferrer">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" target="_blank" rel="noopener noreferrer"> 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" target="_blank" rel="noopener noreferrer"> 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" rel="noreferrer">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" rel="noreferrer">stefan.uhrig@sap.com</a>><br />> *Cc:* qgis-developer <<a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">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" rel="noreferrer">stefan.uhrig@sap.com</a><br />> <mailto:<a href="mailto:stefan.uhrig@sap.com" rel="noreferrer">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" target="_blank" rel="noopener noreferrer">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" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a> <mailto:<a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a>><br />>     List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />>     Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> 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" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> 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" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></span></p>
</blockquote>
</div>
</div>
</div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">_______________________________________________<br />QGIS-Developer mailing list<br /><a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></span></p>
</blockquote>
</div>
</div>
</div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Courier New';">_______________________________________________<br />QGIS-Developer mailing list<br /><a href="mailto:QGIS-Developer@lists.osgeo.org" rel="noreferrer">QGIS-Developer@lists.osgeo.org</a><br />List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br />Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank" rel="noopener noreferrer"> https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></span></p>
</div>
</blockquote>
<p><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;"> </span></p>
<div id="v1signature">
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Verdana',sans-serif;">-- </span></p>
<div>
<p class="v1MsoNormal"><span style="font-size: 10.0pt; font-family: 'Courier New';">--<br />Benjamin Jakimow, Doctoral Researcher<br />Earth Observation Lab | Geography Department | Humboldt-Universität zu Berlin<br /><br />e-mail: <a href="mailto:benjamin.jakimow@geo.hu-berlin.de" rel="noreferrer">benjamin.jakimow@geo.hu-berlin.de</a><br /><br />phone:  +49 (0) 30 2093 6894<br />mobile: +49 (0) 157 5656 8477<br />fax:    +49 (0) 30 2093 6848<br />mail:   Unter den Linden 6 | 10099 Berlin | Germany<br />room: 2'222</span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p><br /></p>
<div id="signature">-- <br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">--<br />Benjamin Jakimow, Doctoral Researcher<br />Earth Observation Lab | Geography Department | Humboldt-Universität zu Berlin<br /><br />e-mail: <a href="mailto:benjamin.jakimow@geo.hu-berlin.de">benjamin.jakimow@geo.hu-berlin.de</a><br /><br />phone:  +49 (0) 30 2093 6894<br />mobile: +49 (0) 157 5656 8477<br />fax:    +49 (0) 30 2093 6848<br />mail:   Unter den Linden 6 | 10099 Berlin | Germany<br />room: 2'222</div>
</div>
</body></html>