[vtkusers] CMAKE + VTK + QT

Clinton Stimpson clinton at elemtech.com
Tue Sep 15 18:29:38 EDT 2009


I just looked at the Ubuntu VTK packages that your cmake configure step is 
picking up.  They are broken wrt building the VTK/Qt examples.
So just be sure to specify your VTK instead of letting it pick up the 
installed one.  And delete your CMakeCache.txt file if you need to start again.

Clint

On Tuesday 15 September 2009 01:59:58 pm Clinton Stimpson wrote:
> In the VTK/Qt examples the first thing it needs is which VTK to use.
> If it never asked you, then it probably picked up the VTK you installed
> instead of the one you just compiled, because it wouldn't know where you
> compiled it.  And perhaps the VTK you have installed doesn't work with the
> Qt examples because you haven't installed the libvtk5-qt4-dev package.
>
> try this
> cmake -DVTK_DIR:PATH=/path/to/my/vtk/  .
>
> Clint
>
> On Tuesday 15 September 2009 01:41:12 pm Nicolas RANNOU wrote:
> > If I go in my VTK-build/bin/
> >
> > the qt examples executables are there and work properly.
> >
> > So almost nothing must be missing. I just have to understand why cmake
> > does not find qt.
> >
> > If move VTK/Examples/GUI/Qt/SimpleView folder to my /home/nico/
> > directory. Then I run ccmake . in the folder /home/nico/SimpleView, cmake
> > asks to set the DESIRED_QT_VERSION. I put 4.
> >
> > and the following errors happen:
> >
> >   CMake was unable to find desired QT version: 4. Set advanced values
> >   QT_QMAKE_EXECUTABLE and QT4_QGLOBAL_FILE.
> >
> > and if I set manually the path to qmake it doesn't find it anymore...
> >
> >
> > Thanks,
> >
> > Nicolas
> >
> > On Tue, 15 Sep 2009 15:28:20 -0400, Nicolas RANNOU
> >
> > <nrannou at bwh.harvard.edu> wrote:
> > > So now I built VTK properly but I can't compile the QT examples.
> > >
> > > settings:
> > >
> > >
> > >  CMAKE_BACKWARDS_COMPATIBILITY    2.4
> > >
> > >  CMAKE_BUILD_TYPE
> > >
> > >  CMAKE_INSTALL_PREFIX             /usr/local
> > >
> > >  DESIRED_QT_VERSION               4
> > >
> > >  EXECUTABLE_OUTPUT_PATH
> > >
> > >  LIBRARY_OUTPUT_PATH
> > >
> > >  QT_QMAKE_EXECUTABLE              /usr/bin/qmake-NOTFOUND
> > >
> > >  VTK_DIR                          /usr/lib/vtk-5.0
> > >
> > > output:
> > >
> > >  CMake was unable to find desired QT version: 4. Set advanced values
> > >  QT_QMAKE_EXECUTABLE and QT4_QGLOBAL_FILE.
> > >
> > > It is very strange because during VTK build, cmake finds qmake at the
> >
> > same
> >
> > > path and when I try to build the example it does not find it.
> > >
> > >
> > > Nicolas
> > >
> > > On Tue, 15 Sep 2009 12:36:10 -0600, Clinton Stimpson
> > > <clinton at elemtech.com>
> > >
> > > wrote:
> > >> Then can you check the following variables, and report their values?
> > >> QT_LIBRARY_DIR
> > >> QT_INCLUDE_DIR
> > >> QT_MOC_EXECUTABLE
> > >> QT_UIC_EXECUTABLE
> > >> QT_RCC_EXECUTABLE
> > >> QT_QTCORE_LIBRARY
> > >>
> > >> They all need to be filled in and correct, or you'll get that Qt was
> > >> not found
> > >> error.  I think last time it came to this on this list, the
> > >> installation of Qt
> > >> was incorrect.
> > >>
> > >> Clint
> > >>
> > >> On Tuesday 15 September 2009 12:30:17 pm Nicolas RANNOU wrote:
> > >>> /usr/bin/qmake --version gives
> > >>>
> > >>> QMake version 2.01a
> > >>> Using Qt version 4.5.0 in /usr/lib
> > >>>
> > >>> Nicolas
> > >>>
> > >>>
> > >>> On Tue, 15 Sep 2009 12:29:15 -0600, Clinton Stimpson
> > >>
> > >> <clinton at elemtech.com>
> > >>
> > >>> wrote:
> > >>> > And what does
> > >>> > /usr/bin/qmake --version give?
> > >>> >
> > >>> > Clint
> > >>> >
> > >>> > On Tuesday 15 September 2009 12:23:24 pm Nicolas RANNOU wrote:
> > >>> >> Thanks Clint I missed it...
> > >>> >>
> > >>> >> So no I turned on VTK_USE_QVTK and VTK_USE_GUISUPPORT.
> > >>> >> but during the configuration of the cmake, when I set the
> > >>> >> QT_DESIRED_VERSION to 4 then when I configure it again,  cmake is
> > >
> > > not
> > >
> > >>> > able
> > >>> >
> > >>> >> to find qt:
> > >>> >>
> > >>> >> cmake output:
> > >>> >> Qt was not found
> > >>> >>
> > >>> >>
> > >>> >> same error when I set the path to the qmake executable manually:
> > >>> >>
> > >>> >>  QT_QMAKE_EXECUTABLE              /usr/bin/qmake-NOTFOUND
> > >>> >>
> > >>> >> ...
> > >>> >>
> > >>> >> Thanks,
> > >>> >>
> > >>> >> Nicolas
> > >>> >>
> > >>> >>
> > >>> >> On Tue, 15 Sep 2009 11:16:48 -0600, Clinton Stimpson
> > >>> >
> > >>> > <clinton at elemtech.com>
> > >>> >
> > >>> >> wrote:
> > >>> >> >> A strange thing I must have noticed first, is that when I built
> > >>
> > >> vtk,
> > >>
> > >>> > I
> > >>> >
> > >>> >> >> can't turn on/off  VTK_USE_QVTK and VTK_USE_GUISUPPORT.
> > >>> >> >>
> > >>> >> >> The options are not available in cmake when I run "ccmake
> > >
> > > ../VTK",
> > >
> > >> to
> > >>
> > >>> >> >> configure cmakelists before building VTK.
> > >>> >> >
> > >>> >> > Hit the 't' button in ccmake to see advanced variables.
> > >>> >> > You'll see VTK_USE_GUISUPPORT.  Turn it on, and configure again,
> > >>
> > >> then
> > >>
> > >>> >> > VTK_USE_QVTK will show up.  Turn it on, then configure again.
> > >
> > > Then
> > >
> > >>> > the
> > >>> >
> > >>> >> Qt
> > >>> >>
> > >>> >> > related variables will show up.
> > >>> >> >
> > >>> >> > So yes, you need to build VTK with Qt support before you can
> > >>> >> > build examples.
> > >>> >> > Or, install the libvtk5-qt4-dev package (from previous messages,
> > >>
> > >> you
> > >>
> > >>> > were
> > >>> >
> > >>> >> > using ubuntu, right?), if you don't have a real reason to build
> > >>> >> > it yourself.
> > >>> >> >
> > >>> >> > Clint
> > >
> > > _______________________________________________
> > > Powered by www.kitware.com
> > >
> > > Visit other Kitware open-source projects at
> > > http://www.kitware.com/opensource/opensource.html
> > >
> > > Please keep messages on-topic and check the VTK FAQ at:
> > > http://www.vtk.org/Wiki/VTK_FAQ
> > >
> > > Follow this link to subscribe/unsubscribe:
> > > http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list