我对 CMake 几乎一无所知。我想要做的是将VTK与Qt一起使用。不幸的是,我被困在 CMake 部分。出于某种原因,当我按“配置”时,出现以下错误:
CMake Error at GUISupport/Qt/CMakeLists.txt:58 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.
我做了什么:
为 Windows 64 位安装 Qt 5.4.1 (VS 2013, 722 MB)
安装 vtk 6.2.0
安装 CMake 3.2.1
提取 vtk,并使用 CMake GUI,设置源代码路径和二进制构建。
设置几个环境变量:
CMAKE_PREFIX_PATH = E:\Qt\Qt5.4.1\5.4\msvc2013_64 QTDIR = E:\Qt\Qt5.4.1 Path = E:\Program Files (x86)\CMake\bin;E:\vtk\bin\bin\Debug;E:\Qt\Qt5.4.1\5.4\msvc2013_64\bin
在 CMake GUI 中,检查以下选项:
VTK_Group_Qt
= 真BUILD_SHARED_LIBS
= 真VTK_QT_VERSION
= 5QT_QMAKE_EXECUTABLE
= E:/Qt/Qt5.4.1/5.4/msvc2013_64/bin/qmake.exe按配置。
得到上述错误。
我应该怎么做才能不出错?
谢谢!