<div dir="ltr">Hi Petar<div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px"> Here are some notes that I use, applicable to Windows, Linux and Macs and VTK 6.x:</div><div style="font-family:arial,sans-serif;font-size:13px">
---------------------------------------------------</div><div style="font-family:arial,sans-serif;font-size:13px">Allow VTK to build against Qt5</div><div style="font-family:arial,sans-serif;font-size:13px">Since VTK build system has been updated to make use of CMake macros</div>
<div style="font-family:arial,sans-serif;font-size:13px">specific to Qt5, the support has to explicitly enable configuring VTK</div><div style="font-family:arial,sans-serif;font-size:13px">with -DVTK_QT_VERSION:STRING="5"</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Additionally, in case Qt5 is not installed in a standard location,</div><div style="font-family:arial,sans-serif;font-size:13px">
a custom prefix for "find_package" should be passed.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">You should set these environment variables:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">On Mac OS X Mavericks:</div><div style="font-family:arial,sans-serif;font-size:13px"> export QTDIR=~/Qt/5.3/clang_64</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"> export PATH</div><div style="font-family:arial,sans-serif;font-size:13px"><br>
</div><div style="font-family:arial,sans-serif;font-size:13px">On Linux (if you have installed Qt):</div><div style="font-family:arial,sans-serif;font-size:13px"> export QTDIR=~/Qt/5.3/gcc_64</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"> export PATH</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
On Windows:</div><div style="font-family:arial,sans-serif;font-size:13px"> QTDIR=C:\Qt\Qt5.3\msvc2012_64_opengl</div><div style="font-family:arial,sans-serif;font-size:13px"> CMAKE_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"> PATH=%QTDIR%\bin:%PATH%</div><div style="font-family:arial,sans-serif;font-size:13px"> For VS2013 set:</div><div style="font-family:arial,sans-serif;font-size:13px">
QTDIR=C:\Qt\Qt5.3\msvc2013_64_opengl</div><div style="font-family:arial,sans-serif;font-size:13px"> CMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64</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"><br></div><div style="font-family:arial,sans-serif;font-size:13px">In the case of Windows and Mac OSX Mavericks:</div><div style="font-family:arial,sans-serif;font-size:13px">
If QTDIR is set and %QTDIR%\bin is added to the system path you do not need</div><div style="font-family:arial,sans-serif;font-size:13px"> to set CMAKE_PREFIX_PATH for the QT directory. However in the case of Windows</div>
<div style="font-family:arial,sans-serif;font-size:13px"> you can set CMAKE_PREFIX_PATH to where the OpenGL libraries are stored, thus</div><div style="font-family:arial,sans-serif;font-size:13px"> removing the need to manually set it each time a new CMake file is generated.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">On Windows:</div><div style="font-family:arial,sans-serif;font-size:13px"> If you are using OpenGL:</div>
<div style="font-family:arial,sans-serif;font-size:13px"> For VS2012:</div><div style="font-family:arial,sans-serif;font-size:13px"> -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"> For VS2013:</div><div style="font-family:arial,sans-serif;font-size:13px"> -DCMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">See: <a href="https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35" target="_blank">https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35</a></div>
<div style="font-family:arial,sans-serif;font-size:13px">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 style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">When using Windows, you may need to Eliminate a warning when building in Windows</div>
<div style="font-family:arial,sans-serif;font-size:13px"> that relates to static linking of Qt executables to qtmain.lib.</div><div style="font-family:arial,sans-serif;font-size:13px"> This policy was introduced in CMake version 2.8.11. CMake version 2.8.11.2</div>
<div style="font-family:arial,sans-serif;font-size:13px"> warns when the policy is not set and uses OLD behavior.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Just do this:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">if(POLICY CMP0020)</div><div style="font-family:arial,sans-serif;font-size:13px">
cmake_policy(SET CMP0020 NEW)</div><div style="font-family:arial,sans-serif;font-size:13px">endif()</div><div style="font-family:arial,sans-serif;font-size:13px">---------------------------------------------------<br><div class="gmail_extra">
<br></div><div class="gmail_extra">I hope this helps.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards</div><div class="gmail_extra"> Andrew</div><div class="gmail_extra"><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>---------- Forwarded message ----------<br>From: Petar Petrov <<a href="mailto:pip010@gmail.com">pip010@gmail.com</a>><br>
To: "<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>>, "<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
Cc: <br>Date: Fri, 27 Jun 2014 18:34:24 +0200<br>Subject: [vtk-developers] building vtk 6.1 with qt 5.2.1<br>there are instructions for building what i want:<br>
<a href="http://www.vtk.org/Wiki/VTK/Configure_and_Build" target="_blank">http://www.vtk.org/Wiki/VTK/Configure_and_Build</a><br>
however i face issues with glut32 not found. similar to :<br>
<a href="http://qt-project.org/forums/viewthread/30006/" target="_blank">http://qt-project.org/forums/viewthread/30006/</a><br>
I do have win sdk 8 installed, followed all instruction but still<br>
CMAKE complains:<br>
<br>
CMake Error at G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16<br>
(message):<br>
Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".<br>
Call Stack (most recent call first):<br>
G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:52<br>
(_qt5gui_find_extra_libs)<br>
G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:152<br>
(include)<br>
G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:94<br>
(find_package)<br>
GUISupport/Qt/CMakeLists.txt:58 (find_package)<br>
<br>
<br>_______________________________________________<br>
vtk-developers mailing list<br>
<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________
</div></div>