首页 > 其他分享 >恢复VCPkg(2023-01-27)中Vtk[Qt]的默认依赖为Qt5

恢复VCPkg(2023-01-27)中Vtk[Qt]的默认依赖为Qt5

时间:2024-02-23 22:48:42浏览次数:30  
标签:27 Qt vtk ports vcpkg patch Vtk qtbase qt

通过查看vtk的更新的日志已于2023-01-27将默认依赖的Qt的版本由5更新到6

git log -- .\ports\vtk
commit 27fb19bdcc1f6ddb1261cffb5372724ac1d63a93
Author: Lily Wang <[email protected]>
Date:   2023-08-23

    [many ports] Fix URLS of download patch (#33309)

    * [many ports] Fix URLS of download patch

    * update version

    * Fix opencv4 and minhook

    * update version

.......

commit 46dda5372b08b614645c74679a61a2498d5926f6
Author: Alexander Neumann <[email protected]>
Date:   2023-01-27

    [vtk|opencv4|openimageio] Switch to Qt6 (#29078)

    * Switch stuff to Qt6

    * give opencv4 the correct deps

    * add Qt5Compat to find_dependency

    * refine vtk deps and promote targets to global

    * fix dep

    * ci is probably faster than my desktop pc building.

    * remove invalid patch part

    * add qt6 patch

    * second patch

    * make openimageio ignore qt5

    * [skip actions] qt6 part 3

    * vtk qt6 patch

    * try openimageio again

    * move gl include

    * fix patch

    * does it work now?

    * remove qualified name

    * more qt6 fixes

    * more patches

    * update and fix rtabmap

    * gles feature in qtbase needs to be disabled for vtk since vtk assumes desktop opengl

    * remove patch add error if qtbase was build with gles2

    * disable also second patch

    * fix theia

    * paraview consolidate patches

    * fix case issue

    * fix missing ,

    * add more qt6 changes

    * remove unnecessary patches

    * bump port version

    * remove comments from vtk

    * add platform features for tools.

    * fix format

    * bump ports

    * another one to bump

    * v db

    Co-authored-by: Billy Robert O'Neal III <[email protected]>

在太多数情况下,还是在使用Qt5的,暂时还没有将项目切换到Qt6,那么需要使用Vtk[Qt]时可能会出现麻烦,以下是经过对比Vtk作者由Qt5更换为Qt6默认依赖时发现,恢复默认依赖为Qt5的办法:
ports/vtk/portfile.cmake
ports/vtk/vcpkg.json
对应的修改如下:

diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake
index f33e09d50..393329b41 100644
--- a/ports/vtk/portfile.cmake
+++ b/ports/vtk/portfile.cmake
@@ -135,13 +135,13 @@ list(TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=OFF" "=DONT_WANT")
 if("qt" IN_LIST FEATURES AND NOT EXISTS "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt5/bin/qmlplugindump${VCPKG_HOST_EXECUTABLE_SUFFIX}")
     list(APPEND VTK_FEATURE_OPTIONS -DVTK_MODULE_ENABLE_VTK_GUISupportQtQuick=NO)
 endif()
-if("qt" IN_LIST FEATURES)
-    file(READ "${CURRENT_INSTALLED_DIR}/share/qtbase/vcpkg_abi_info.txt" qtbase_abi_info)
-    if(qtbase_abi_info MATCHES "(^|;)gles2(;|$)")
-        message(FATAL_ERROR "VTK assumes qt to be build with desktop opengl. As such trying to build vtk with qt using GLES will fail.")
-        # This should really be a configure error but using this approach doesn't require patching.
-    endif()
-endif()
+# if("qt" IN_LIST FEATURES)
+#     file(READ "${CURRENT_INSTALLED_DIR}/share/qtbase/vcpkg_abi_info.txt" qtbase_abi_info)
+#     if(qtbase_abi_info MATCHES "(^|;)gles2(;|$)")
+#         message(FATAL_ERROR "VTK assumes qt to be build with desktop opengl. As such trying to build vtk with qt using GLES will fail.")
+#         # This should really be a configure error but using this approach doesn't require patching.
+#     endif()
+# endif()

 if("python" IN_LIST FEATURES)
     set(python_ver "")
@@ -247,7 +247,7 @@ vcpkg_cmake_configure(
         ${ADDITIONAL_OPTIONS}
         -DVTK_DEBUG_MODULE_ALL=ON
         -DVTK_DEBUG_MODULE=ON
-        -DVTK_QT_VERSION=6
+        -DVTK_QT_VERSION=5
         -DCMAKE_INSTALL_QMLDIR:PATH=qml
         -DVCPKG_HOST_TRIPLET=${_HOST_TRIPLET}
         -DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON # Due to Qt6::Platform not being found on Linux platform
diff --git a/ports/vtk/vcpkg.json b/ports/vtk/vcpkg.json
index 79cec81ca..5f5861da3 100644
--- a/ports/vtk/vcpkg.json
+++ b/ports/vtk/vcpkg.json
@@ -197,21 +197,10 @@
     "qt": {
       "description": "Qt functionality for VTK",
       "dependencies": [
-        {
-          "name": "qtbase",
-          "default-features": false,
-          "features": [
-            "gui",
-            "opengl",
-            "widgets"
-          ]
-        },
-        "qtdeclarative",
-        "qtimageformats",
-        {
-          "name": "qttools",
-          "default-features": false
-        }
+        "qt5-base",
+        "qt5-declarative",
+        "qt5-imageformats",
+        "qt5-tools"
       ]
     },
     "utf8": {

标签:27,Qt,vtk,ports,vcpkg,patch,Vtk,qtbase,qt
From: https://www.cnblogs.com/linxmouse/p/18030499

相关文章

  • pytest简易教程(27):pytest常用插件 - 失败重试(pytest-rerunfailures)
     pytest简易教程汇总,详见:https://www.cnblogs.com/uncleyong/p/17982846关于插件pytest有很多第三方插件:https://docs.pytest.org/en/latest/reference/plugin_list.html#plugin-list总共1300多个,一般最近1年内有更新的都是常用的。 使用场景针对运行不通过的用例运行重......
  • 全志T527国产核心板及米尔配套开发板批量上市!
    2023年12月,米尔电子联合战略合作伙伴全志科技,率先业内发布了国产第一款T527核心板及开发板。这款高性能、高性价比、八核A55的国产核心板吸引了广大客户关注,为积极响应客户需求,米尔基于全志T527核心板现已批量上市,欢迎垂询! 图:米尔国产核心板-第一款全志T527核心板 全志T52......
  • 创纪录:英伟达市值一日增 2770 亿美元;Xiaomi 14 Ultra 正式发布丨 RTE 开发者日报 Vol.
       开发者朋友们大家好: 这里是「RTE开发者日报」,每天和大家一起看新闻、聊八卦。我们的社区编辑团队会整理分享RTE(RealTimeEngagement)领域内「有话题的新闻」、「有态度的观点」、「有意思的数据」、「有思考的文章」、「有看点的会议」,但内容仅代表......
  • Qt使用mysql数据库
    此内容来自网络,有一定参考作用吧1.官网下载链接:https://dev.mysql.com/downloads/mysql/5.7.html2.下载解压上面的mysql,后更改Qt源码目录的两处路径配置3.打开QT安装路径下的源码C:\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers\mysql双击用QTCreator打开mysql.pro(1)打开mysql......
  • QT 串口上位机
    CMakeLists.txtcmake_minimum_required(VERSION3.5)project(SerialPortVERSION0.1LANGUAGESCXX)set(CMAKE_AUTOUICON)set(CMAKE_AUTOMOCON)set(CMAKE_AUTORCCON)set(CMAKE_CXX_STANDARD17)set(CMAKE_CXX_STANDARD_REQUIREDON)find_package(QTNAMESQt......
  • 代码随想录算法训练营day02 | leetcode 977. 有序数组的平方、35.搜索插入位置、34.在
    题目链接:977.有序数组的平方-简单题目描述:给你一个按非递减顺序排序的整数数组nums,返回每个数字的平方组成的新数组,要求也按非递减顺序排序。示例1:输入:nums=[-4,-1,0,3,10]输出:[0,1,9,16,100]解释:平方后,数组变为[16,1,0,9,100]排序后,数组变为[0,1,9,16,100]......
  • QT使用OpenSSL的接口实现RSA2的签名和验签
    QT使用OpenSSL的接口实现RSA2的签名和验签加密和签名在RSA加密算法中是两个不同的概念,虽然它们都涉及RSA密钥对的使用,但目的和应用场景有所不同。加密(encrypt/decrypt):加密:使用接收方的公钥对数据进行加密,只有拥有相应私钥的接收方才能解密数据。解密:使用接收方的私钥对......
  • Qt 图例类QLegend详解
    概述在Qt绘制图表时,图例并不是由QChart类所管理的,而是交给单独的QLegend类。QLegend类负责图例的绘制(包括颜色、线型、字体等),它与图表类QChart的关系是attach和detach。实例参考官方实例:X:\Qt\Qt5.9.0\Examples\Qt-5.9\charts\legend运行效果:功能详解设置图例标......
  • 微星MPG 271QRX QD-OLED评测:显示器中的顶级旗舰 三大色域满分更全能
    一、前言:微星带来旗舰QD-OLED显示器解决文字清晰度较差的问题CES国际消费电子展,可以说是科技巨头争奇斗艳的舞台,在CES2024微星在展会上,就为消费者带来了多个PC设备,也荣获了“游戏&电竞”和”计算机周边&配件”类创新奖。其中最值得关注的,就是使用了全新技术的QD-OLED系列显示......
  • 逆向实战30——阿里227逆向分析
    前言本文章中所有内容仅供学习交流,抓包内容、敏感网址、数据接口均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关,若有侵权,请联系我立即删除!公众号链接星球链接目标网站aHR0cHM6Ly93ZS41MWpvYi5jb20=227的很多。可以自己去找。不是不写太长......