【发布时间】:2014-06-17 13:05:10
【问题描述】:
我编译并安装了 Qt 5.2.1,但现在即使使用 CMake 配置 VTK 6.1.0 也有问题。我检查了“VTK_Group_Qt”,将 Qt 版本设置为 5,提供了 qmake.exe 的路径并将 CMAKE_PREFIX_PATH 设置为 Qt 安装目录,即“D:/Qt/Qt-5.2.1/win32”。到目前为止有效。当我现在再次配置时,CMake 抱怨:
CMake Error at D:/Qt/Qt-5.2.1/win32/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:15 (message):
The imported target "Qt5::Widgets" references the file
"D:/Qt/Qt-5.2.1/install/include/"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"D:/Qt/Qt-5.2.1/win32/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake"
but not all the files it references.
Call Stack (most recent call first):
D:/Qt/Qt-5.2.1/win32/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:58 (_qt5_Widgets_check_file_exists)
GUISupport/Qt/CMakeLists.txt:58 (find_package)
错误是正确的,因为实际上缺少“D:/Qt/Qt-5.2.1/install/include/”目录...打开“Qt5WidgetsConfig.cmake”文件时,我发现硬编码路径如
set(imported_location "${_qt5Widgets_install_prefix}/install/bin/${LIB_LOCATION}")
这是错误的。 “安装”应该不存在。
在配置 Qt 时,我设置了前缀选项“-prefix ./install”,因此在“nmake install”之后我有一个干净的安装目录(与使用默认的 qtbase 相比,这是一团糟),它似乎已将此路径写入生成的 .cmake 文件中...
这是一个 Qt 错误吗?有解决办法吗?!
【问题讨论】:
-
一种解决方法显然是将整个 Qt 安装复制到“../install”,但我认为这不是应该的工作方式......