<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">Hi All, </span></div><div><br></div><div><font face="arial, sans-serif">I have been experimenting with VTK and Qt5 with some success. If anyone can improve on these instructions, please do! I hope people find these instructions useful.</font></div>
<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">----------------------------------------------------------------------------------------</font></div><span style="font-family:arial,sans-serif;font-size:13px">You need:</span><div style="font-family:arial,sans-serif;font-size:13px">
1) Visual Studio Express 2012</div><div style="font-family:arial,sans-serif;font-size:13px">2) Qt5: <a href="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" target="_blank">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</a></div>
<div style="font-family:arial,sans-serif;font-size:13px">( Note you need the OpenGL version for use with VTK.)</div><div style="font-family:arial,sans-serif;font-size:13px">3) The VTK master from the Git Repositery:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><a href="http://www.vtk.org/VTK/resources/software.html#dev" target="_blank">http://www.vtk.org/VTK/resources/software.html#dev</a><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Before running CMake do this:</div><div style="font-family:arial,sans-serif;font-size:13px">Set the following environment variables:</div><div><div style="font-family:arial,sans-serif;font-size:13px">
QTDIR=C:\Qt\Qt5.1.0\5.1.0\msvc2012_64_opengl</div><div style="font-family:arial,sans-serif;font-size:13px"> PATH=%QTDIR%\bin:%PATH%</div><div style="font-family:arial,sans-serif;font-size:13px">Start ccmake with -DVTK_QT_VERSION:STRING="5" -DCMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64</div>
<div style="font-family:arial,sans-serif;font-size:13px">If you are using cmake-gui (the preferred way) then enter these variables before pressing the "Configure" button.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">After the initial configuration, ensure VTK_Group_Qt is selected. Press "Configure"again.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>In the case of Windows, you will get lots of warnings like this:</div><div>CMake Warning (dev) in GUISupport/Qt/Testing/Cxx/CMakeLists.txt:</div><div>
Policy CMP0020 is not set: Automatically link Qt executables to qtmain</div><div> target on Windows. Run "cmake --help-policy CMP0020" for policy details.</div><div> Use the cmake_policy command to set the policy and suppress this warning.</div>
<div>This warning is for project developers. Use -Wno-dev to suppress it.</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Finally press "Generate".</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">For more information see:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>See: <a href="https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35" target="_blank">https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35</a></div>
<div>and: <a href="http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake" target="_blank">http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake</a></div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">
Note that on both the Mac and windows:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>You should set these environment variables:</div><div><br></div><div>On Mac OS X Lion:</div><div> export QTDIR=/Users/andrewmaclean/Qt5.1.0/5.1.0/clang_64/</div>
<div> export PATH=$QTDIR/bin:$PATH</div><div><br></div><div>On Windows:</div><div> QTDIR=C:\Qt\Qt5.1.0\5.1.0\msvc2012_64_opengl</div><div> PATH=%QTDIR%\bin:%PATH%</div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">
If you do this then you do not need to set CMAKE_PREFIX_PATH to QTDIR.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div><div><font face="arial, sans-serif">For more information see: <a href="https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35">https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35</a></font></div>
<div><font face="arial, sans-serif">and: <a href="http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake">http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake</a></font></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div></div></div><div style="font-family:arial,sans-serif;font-size:13px"><div style="font-family:arial;font-size:small"><font face="arial, sans-serif">----------------------------------------------------------------------------------------</font></div>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Regards</div><div style="font-family:arial,sans-serif;font-size:13px"> Andrew</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">PS: Apologies for the previous incomplete e-mail message - my cat posted it prematurely.</div><div class="gmail_extra"><br><br>-- <br>___________________________________________<br>
Andrew J. P. Maclean<br><br>___________________________________________
</div></div>