Qgis3.370编译记录 VS2022
编译环境&&软件版本
(1)Windows 10 64位 专业版
(2)[Visual Studio Community 2022(社区版)](https://visualstudio.microsoft.com/zh-hans/vs/?keys=android%E9%A1%B9%E7%9B%AE%E5%AE%9E%E8%B7%B5)
(3)[CMake-3.28.0 64位](https://cmake.org/files/v3.28/)
(4)[Cygwin 64位](https://cygwin.com/install.html)
(5)[OSGeo4W 64位](https://www.qgis.org/en/site/forusers/download.html)
(7)[QGIS-3.37.0 源码](https://github.com/qgis/QGIS?tab=readme-ov-file)
CMake、OSGeo4W和Cygwin的安装部署参考
https://blog.csdn.net/Jisoo9527/article/details/135717421
OSGeo4W环境qgis-dev-deps 选择3.37版本,最好都装在c盘 否则后面修改的东西会变多
导出vs工程
修改源码中的configonly.bat
ms-windows\osgeo4w\configonly.bat
修改源码中的msvc-env.bat
ms-windows\osgeo4w\msvc-env.bat
找不到路径的可以下载一个Everything搜索
修改源码中的package-nightly.cmd
ms-windows\osgeo4w\package-nightly.cmd
新增一条 GRASS_PREFIX8
打开cmd窗口 运行configonly.bat
出现Canfigurins done (7.0s,Generating done (15. 5s)则成功,出现错误通常是msvc-env.bat和package-nightly.cmd的部分库路径设置错误
输出在QGIS-master\ms-windows\osgeo4w\build-qgis-test-x86_64
错误整理
Could not find GRASS 7Could not find GRASS 8
msvc-env.bat GRASS7未修改
cMake Warning at cmake/FindProj.cmake:21 (find package):Found package configuration file:
C:/0SGeo4W64/1ib/cmake/proj/proj-config.cmake
but it set PROJ_FOUND to FALSE so package “PROJ” is considered to be NOTFOUND.Reason given by package:
PROI could not be found because dependency SQLite3 could not be found
al1 Stack (most recent call first,CMakeLists.txt:361 (find package.
cllake Error at cmake/FindProj.cmake:74 (FILE):FILE failed to open for reading (No such file or directory):
C:/0SGeo4W64/apps/proj-dev/include/proj api.hal1 Stack (most recent call first]:CMakeLists.txt:361 (find package)
package-nightly.cmd中的Proj未修改
Could NOT find PkgConfig (missing: PKG CONFIG EXECUTABLE)
不用管