[vtkusers] [vtk-developers] building vtk 6.1 with qt 5.2.1

Andrew Maclean andrew.amaclean at gmail.com
Fri Jun 27 17:05:26 EDT 2014


Hi Petar

   Here are some notes that I use, applicable to Windows, Linux and Macs
and VTK 6.x:
---------------------------------------------------
Allow VTK to build against Qt5
Since VTK build system has been updated to make use of CMake macros
specific to Qt5, the support has to explicitly enable configuring VTK
with -DVTK_QT_VERSION:STRING="5"

Additionally, in case Qt5 is not installed in a standard location,
a custom prefix for "find_package" should be passed.

You should set these environment variables:

On Mac OS X Mavericks:
  export QTDIR=~/Qt/5.3/clang_64
  PATH=$QTDIR/bin/:$PATH
  export PATH

On Linux (if you have installed Qt):
  export QTDIR=~/Qt/5.3/gcc_64
  PATH=$QTDIR/bin/:$PATH
  export PATH

On Windows:
  QTDIR=C:\Qt\Qt5.3\msvc2012_64_opengl
  CMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows
Kits/8.0/Lib/win8/um/x64
  PATH=%QTDIR%\bin:%PATH%
  For VS2013 set:
  QTDIR=C:\Qt\Qt5.3\msvc2013_64_opengl
  CMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows
Kits/8.1/Lib/winv6.3/um/x64
  PATH=%QTDIR%\bin:%PATH%

In the case of Windows and Mac OSX Mavericks:
If QTDIR is set and %QTDIR%\bin is added to the system path you do not need
 to set CMAKE_PREFIX_PATH for the QT directory. However in the case of
Windows
 you can set CMAKE_PREFIX_PATH to where the OpenGL libraries are stored,
thus
 removing the need to manually set it each time a new CMake file is
generated.

On Windows:
  If you are using OpenGL:
  For VS2012:
  -DCMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows
Kits/8.0/Lib/win8/um/x64
  For VS2013:
  -DCMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows
Kits/8.1/Lib/winv6.3/um/x64


See:
https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35
and: http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake


When using Windows, you may need to Eliminate a warning when building in
Windows
 that relates to static linking of Qt executables to qtmain.lib.
 This policy was introduced in CMake version 2.8.11. CMake version 2.8.11.2
 warns when the policy is not set and uses OLD behavior.

Just do this:

if(POLICY CMP0020)
  cmake_policy(SET CMP0020 NEW)
endif()
---------------------------------------------------

I hope this helps.

Regards
    Andrew




> ---------- Forwarded message ----------
> From: Petar Petrov <pip010 at gmail.com>
> To: "vtk-developers at vtk.org" <vtk-developers at vtk.org>, "vtkusers at vtk.org"
> <vtkusers at vtk.org>
> Cc:
> Date: Fri, 27 Jun 2014 18:34:24 +0200
> Subject: [vtk-developers] building vtk 6.1 with qt 5.2.1
> there are instructions for building what i want:
> http://www.vtk.org/Wiki/VTK/Configure_and_Build
> however i face issues with glut32 not found. similar to :
> http://qt-project.org/forums/viewthread/30006/
> I do have win sdk 8 installed, followed all instruction but still
> CMAKE complains:
>
> CMake Error at
> G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:16
> (message):
> Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE "".
> Call Stack (most recent call first):
>
> G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:52
> (_qt5gui_find_extra_libs)
>
> G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:152
> (include)
>
> G:/Qt/Qt5.2.1/5.2.1/msvc2012_64_opengl/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:94
> (find_package)
> GUISupport/Qt/CMakeLists.txt:58 (find_package)
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>


-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140628/e13c21c0/attachment.html>


More information about the vtkusers mailing list