[vtkusers] building VTK w/QT4 under MacOS 10.4.1

Damion Shelton beowulf at cs.cmu.edu
Thu Jun 16 17:42:46 EDT 2005


Hello,

I've been trying to build the VTK QT widget using the following  
software versions:

VTK CVS
CMake CVS
QT 4.0.0 rc1 20050609 snapshot
MacOS 10.4.1

My understanding is that CMake does not currently support QT 4.0  
correctly, so I've tried two different approaches mentioned in the  
cmake archives. The first is described in:

http://public.kitware.com/pipermail/cmake/2005-June/006617.html

While this seems like the most complete solution, there are syntax  
problems reported in the CVS version of CMake. The second approach  
suggested was a much simpler FindQT.cmake (attached at end, I've lost  
track of the original link). I had to edit the CMakeLists.txt file  
in /GUISupport/Qt to change the QT3 references to QT4, but no other  
editing appeared necessary.

Most of the QT stuff appears to build correctly, but the following  
error is generated when building the plugin itself:

make[2]: *** No rule to make target `/Users/beowulf/Devel/qt-mac- 
opensource-4.0.0-rc1-snapshot-20050609/lib/qtcore', needed by `bin/ 
libQVTKWidgetPlugin.dylib'.  Stop.

Any suggestions? VTK builds correctly with QT support disabled, and  
QT 4.0.0rc1 builds correctly as well.

Thanks in advance,
Damion

---Attachment: FindQT.cmake---

SET (QT_INCLUDE_DIR $ENV{QTDIR}/include $ENV{QTDIR}/include/Qt $ENV 
{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/ 
QtOpenGL )
SET (QT_LIBRARIES $ENV{QTDIR}/lib/qtcore $ENV{QTDIR}/lib/qtmain $ENV 
{QTDIR}/lib/qtGUI $ENV{QTDIR}/lib/qtOpenGL winmm imm32 wsock32)
SET (QT_LIBRARIES_DEBUG $ENV{QTDIR}/lib/qtcored $ENV{QTDIR}/lib/ 
qtmaind $ENV{QTDIR}/lib/qtGUId $ENV{QTDIR}/lib/qtOpenGLd winmm imm32  
wsock32)
SET (QT_FOUND YES)

FIND_PROGRAM(QT_MOC_EXECUTABLE
   NAMES moc
   PATHS
   $ENV{QTDIR}/bin
   )

FIND_PROGRAM(QT_UIC_EXECUTABLE uic
   $ENV{QTDIR}/bin
   )

INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})


# The line below doesn't work even though I think it should.
#LINK_LIBRARIES( optimized ${QT_LIBRARIES} debug ${QT_LIBRARIES_DEBUG} )
# so I use this workaround

FOREACH( releaselib ${QT_LIBRARIES} )
   LINK_LIBRARIES( optimized ${releaselib} )
ENDFOREACH( releaselib )

FOREACH( debuglib ${QT_LIBRARIES_DEBUG} )
   LINK_LIBRARIES( debug ${debuglib} )
ENDFOREACH( debuglib )



More information about the vtkusers mailing list