[vtkusers] CMake problem (VTK 6.1 - Qt 5.3)

Andrew Maclean andrew.amaclean at gmail.com
Tue Jul 29 19:01:04 EDT 2014


Luis, you should have no problems building VTK 6.1+ with QT5.3  and VS2013
I have attached the instructions I use.
There is a link you also might like to look at:
http://www.vtk.org/Wiki/VTK/Configure_and_Build#Qt5..2A

However my instructions do differ from those there.

Regards
   Andrew



>
> ---------- Forwarded message ----------
> From: Luis Vieira <luis.vieira at vektore.com>
> To: vtkusers at vtk.org
> Cc:
> Date: Tue, 29 Jul 2014 13:28:57 -0400
> Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3)
>
>  Hi. I am beginner with Qt and VTK. Then,  I will let you how I have
> doing. I have been working with Qt 5.3.1 and VS2013 perfectly. Last week I
> tried to set up VTK 6.1 with VS2013 through CMake 3.0 and works perfectly.
> As well you could see below.  Now, I am try to enable VTK with Qt 5.3.1
> through CMake. However, whatever I do to set VT_QT options my CMake only
> found Qt4 through this file FindQt4.cmake in my C:\Program Files
> (x86)\CMake\share\cmake-3.0\Modules. I am pretty sure that it's the problem.
>
>
>
> *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt*
> * CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin*
> *VTK_Group_Qt:BOOL=ON;*
>
> *
> QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe.
> *
>
>
>
>
>
> Where I could change that?
> "The first thing that have the first time that compile vtk with qt module
> is that I have to change the flag to qt 5 and erase the flags of qt 4, and
>  then I configure again, and is ready."
>
> Thank you.
>
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140730/9b482426/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 75255 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140730/9b482426/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 66844 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140730/9b482426/attachment-0003.png>
-------------- next part --------------
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()


More information about the vtkusers mailing list