<div dir="ltr"><div>Hi Stefan,</div><div><br></div><div>vcpkg very recently got a registries feature, so you can avoid forking vcpkg for custom ports (either modifications of existing ports or new ones)<br></div><div><br></div><div>look here: <a href="https://devblogs.microsoft.com/cppblog/registries-bring-your-own-libraries-to-vcpkg/">https://devblogs.microsoft.com/cppblog/registries-bring-your-own-libraries-to-vcpkg/</a> <br></div><div><br></div><div>You can pin each dependency to a specific version using the versioning feature mentioned earlier.</div><div><br></div><div>Mats<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 1, 2021 at 4:36 PM Uhrig, Stefan <<a href="mailto:stefan.uhrig@sap.com">stefan.uhrig@sap.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div style="overflow-wrap: break-word;" lang="DE">
<div class="gmail-m_-7589301108618487303WordSection1">
<p class="MsoNormal"><span>Hi Benjamin,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Thanks for the feedback.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Stefan<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Benjamin Jakimow <<a href="mailto:benjamin.jakimow@geo.hu-berlin.de" target="_blank">benjamin.jakimow@geo.hu-berlin.de</a>>
<br>
<b>Sent:</b> Sunday, February 28, 2021 9:03 AM<br>
<b>To:</b> Mats Taraldsvik <<a href="mailto:mats.taraldsvik@gmail.com" target="_blank">mats.taraldsvik@gmail.com</a>><br>
<b>Cc:</b> Uhrig, Stefan <<a href="mailto:stefan.uhrig@sap.com" target="_blank">stefan.uhrig@sap.com</a>>; qgis-developer <<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>><br>
<b>Subject:</b> Re: [QGIS-Developer] Building QGIS with Visual Studio 2019 CE and vcpkg<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p><span style="font-size:10pt;font-family:"Verdana",sans-serif">Hi Stefan,<u></u><u></u></span></p>
<p><span style="font-size:10pt;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.<u></u><u></u></span></p>
<p><span style="font-size:10pt;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:<u></u><u></u></span></p>
<p><span style="font-size:10pt;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'<u></u><u></u></span></p>
<p><span style="font-size:10pt;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">https://github.com/libspatialindex/libspatialindex/pull/153</a>)<u></u><u></u></span></p>
<p><span style="font-size:10pt;font-family:"Verdana",sans-serif">Best regards, <br>
Benjamin<u></u><u></u></span></p>
<p><span style="font-size:10pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p id="gmail-m_-7589301108618487303reply-intro"><span style="font-size:10pt;font-family:"Verdana",sans-serif">On 2021-02-11 11:29, Mats Taraldsvik wrote:<u></u><u></u></span></p>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(16,16,255);border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0in 0in 0in 5pt;margin-left:0in;margin-right:0in">
<div id="gmail-m_-7589301108618487303replybody1">
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Hi Stefan,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">I did make a few modifications that might help:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">1. Release build:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">- geos_c.lib was detected automatically, and for some reason I did not need to explicitly set GEOS_LIBRARY<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">2. Debug build:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">I hope this does help a bit.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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?):<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">- add your CMakeSettings.json to the build description or to src/CMakeSettings.json<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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).<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">- vcpkg just got versioning, which might help align the requirements with the rest of qgis<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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)<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">- vcpkg does have binary caching, perhaps making a github actions CI build using this method feasible?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Anyway, thank you for your efforts! It made the first QGIS-step more pleasant. :)<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Best regards,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Mats Taraldsvik<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">On Mon, Feb 1, 2021 at 4:24 PM Uhrig, Stefan <<a href="mailto:stefan.uhrig@sap.com" target="_blank">stefan.uhrig@sap.com</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Hi all,<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;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.<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;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.<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;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">https://www.riverbankcomputing.com/pipermail/pyqt/2012-April/031385.html</a>),
 so I might get it working. I'll give it a try.<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Furthermore, I'd like to investigate the zstd.dll vs zstdd.dll load issue before publishing the build instructions.<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Best regards,<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Stefan<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><strong><span style="font-size:10pt;font-family:"Verdana",sans-serif">From:</span></strong><span style="font-size:10pt;font-family:"Verdana",sans-serif"> QGIS-Developer <<a href="mailto:qgis-developer-bounces@lists.osgeo.org" target="_blank">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" target="_blank">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" target="_blank">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<u></u><u></u></span></p>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Hi,<u></u><u></u></span></p>
</div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;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">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.<u></u><u></u></span></p>
</div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
</div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Regards,<u></u><u></u></span></p>
</div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">Harrissou<u></u><u></u></span></p>
</div>
</div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"> <u></u><u></u></span></p>
<div>
<div>
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">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 :<u></u><u></u></span></p>
</div>
<blockquote style="border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<p class="gmail-m_-7589301108618487303v1msonormal"><span style="font-size:10pt;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">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">
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">
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" 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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>     Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" 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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" 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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><u></u><u></u></span></p>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">_______________________________________________<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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><u></u><u></u></span></p>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">_______________________________________________<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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><u></u><u></u></span></p>
</div>
</blockquote>
<p><span style="font-size:10pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<div id="gmail-m_-7589301108618487303signature">
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Verdana",sans-serif">--
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10pt;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" target="_blank">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<u></u><u></u></span></p>
</div>
</div>
</div>
</div>

_______________________________________________<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>