[vtk-developers] Building VTK with QT5 for Windows.
Andrew Maclean
andrew.amaclean at gmail.com
Fri Jul 19 05:18:57 EDT 2013
You need:
1) Visual Studio Express 2012
2) Qt5:
http://download.qt-project.org/official_releases/qt/5.1/5.1.0/qt-windows-opensource-5.1.0-msvc2012_opengl-x86_64-offline.exe
( Note you need the OpenGL version for use with VTK.)
3) The VTK master from the Git Repositery:
http://www.vtk.org/VTK/resources/software.html#dev
Before running CMake do this:
Set the following environment variables:
QTDIR=C:\Qt\Qt5.1.0\5.1.0\msvc2012_64_opengl
PATH=%QTDIR%\bin:%PATH%
Start ccmake
with -DVTK_QT_VERSION:STRING="5" -DCMAKE_PREFIX_PATH:STRING=C:/Program
Files (x86)/Windows Kits/8.0/Lib/win8/um/x64
If you are using cmake-gui (the preferred way) then enter these variables
before pressing the "Configure" button.
After the initial configuration, ensure VTK_Group_Qt is selected. Press
"Configure"again.
In the case of Windows, you will get lots of warnings like this:
CMake Warning (dev) in GUISupport/Qt/Testing/Cxx/CMakeLists.txt:
Policy CMP0020 is not set: Automatically link Qt executables to qtmain
target on Windows. Run "cmake --help-policy CMP0020" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
Finally press "Generate".
For more information see:
See:
https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35
and: http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake
Note that on both the Mac and windows:
You should set these environment variables:
On Mac OS X Lion:
export QTDIR=/Users/andrewmaclean/Qt5.1.0/5.1.0/clang_64/
export PATH=$QTDIR/bin:$PATH
On Windows:
QTDIR=C:\Qt\Qt5.1.0\5.1.0\msvc2012_64_opengl
PATH=%QTDIR%\bin:%PATH%
If you do this then you do not need to set CMAKE_PREFIX_PATH to QTDIR.
--
___________________________________________
Andrew J. P. Maclean
___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20130719/fb92d72d/attachment.html>
More information about the vtk-developers
mailing list