vtk在Cmake时遇到Found unsuitable Qt version "" from NOTFOUND

本文介绍了解决CMake在构建过程中遇到的Qt版本不匹配问题的方法。通过在指定文件中添加find_package指令及设置Qt相关执行文件路径,成功解决了CMakeErroratGUISupport/Qt/CMakeLists.txt:140(QT4_WRAP_CPP):UnknownCMakecommand等错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

cmake报错:

CMake Error at GUISupport/Qt/CMakeLists.txt:140 (QT4_WRAP_CPP): Unknown CMake command "QT4_WRAP_CP

VTK Found unsuitable Qt version "" from NOTFOUND


解决方法:

XXXX\VTK5.10.1\CMakelists.txt
378行添加:
find_package(Qt4 REQUIRED)

388行添加:
set(QT_QMAKE_EXECUTABLE C:\\Qt\\4.8.5.64\\bin\\qmake.exe)
set(QT_MOC_EXECUTABLE C:\\Qt\\4.8.5.64\\bin\\moc.exe)
set(QT_RCC_EXECUTABLE C:\\Qt\\4.8.5.64\\bin\\RCC.exe)
set(QT_UIC_EXECUTABLE C:\\Qt\\4.8.5.64\\bin\\Uic.exe)


XXXX\VTK5.10.1\GUISupport\Qt\CMakelists.txt
4行添加:
find_package(Qt4 REQUIRED)




-- Try 1 failed CMake Warning at cmake/OpenCVDownload.cmake:248 (message): IPPICV: Download failed: 28;"Timeout was reached" For details please refer to the download log file: /home/charon/Opencv/opencv-4.8.0/build/CMakeDownloadLog.txt Call Stack (most recent call first): 3rdparty/ippicv/ippicv.cmake:37 (ocv_download) cmake/OpenCVFindIPP.cmake:259 (download_ippicv) cmake/OpenCVFindLibsPerf.cmake:12 (include) CMakeLists.txt:756 (include) -- Could NOT find CUDNN: Found unsuitable version "..", but required is at least "7.5" (found /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0) -- CUDA detected: 12.5 -- CUDA: Using CUDA_ARCH_BIN=8.9 -- CUDA NVCC target flags: -gencode;arch=compute_89,code=sm_89;-D_FORCE_INLINES -- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off -- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR) -- Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found version "11.0.26") -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file CMake Error at cmake/OpenCVModule.cmake:274 (message): No modules has been found: /home/ub/opencv-4.8.0/opencv_contrib_4.8.0/modules Call Stack (most recent call first): cmake/OpenCVModule.cmake:356 (_glob_locations) cmake/OpenCVModule.cmake:408 (ocv_glob_modules) CMakeLists.txt:967 (ocv_register_modules) -- Checking for module 'gtk+-2.0' -- No package 'gtk+-2.0' found -- Checking for module 'libavresample' -- No package 'libavresample' found CMake Error at modules/core/CMakeLists.txt:54 (message): CUDA: OpenCV requires enabled 'cudev' module from 'opencv_contrib' repository: https://github.com/opencv/opencv_contrib -- Configuring incomplete, errors occurred! See also "/home/charon/Opencv/opencv-4.8
04-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值