Combining Qt 5.4.1 with vtk 6.2.0 (using CMake GUI

2019-01-20 05:18发布

问题:

I know almost nothing about CMake. What I'm trying to do is to use VTK with Qt. Unfortunately, I'm stuck at the CMake part. For some reason, when I press "configure", I get the following error:


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.


What I've done :

  1. Install Qt 5.4.1 for Windows 64-bit (VS 2013, 722 MB)

    Install vtk 6.2.0

    Install CMake 3.2.1

  2. Extract vtk, and using the CMake GUI, set up the source code path and binary build

  3. Set up several variable environment :

    '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

  4. In CMake GUI, check the following options :

    VTK_Group_Qt = true

    BUILD_SHARED_LIBS = true

    VTK_QT_VERSION = 5

    QT_QMAKE_EXECUTABLE = E:/Qt/Qt5.4.1/5.4/msvc2013_64/bin/qmake.exe

  5. Press configure

  6. Get the above error

What should I do to not get any error?

Thank you!