[Insight-users] CMakeLists.txt and Qt

Luis Ibanez luis.ibanez@kitware.com
Thu, 12 Sep 2002 19:29:57 -0400


This is a multi-part message in MIME format.
--------------020301040107080104060205
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Hi George,

An example illustrating how to integrate ITK filters with
a Qt GUI (http://www.trolltech.com)

is available under:

     Insight/Examples/QtITK

You can also access the files directly through CVSWeb

http://www.itk.org/cgi-bin/cvsweb.cgi/Insight/Examples/?cvsroot=Insight

The file itkQtAdaptor.h contains classes to adapt ITK Observers
as Qt Slots and ITK Events as Qt Signals.

A ProgressBar derived fron the QSlider and endowed with an ITK
command (Observer pattern) can be found in itkQtProgressBar.h/cxx

The corresponding CMakeLists.txt file is attached to this email.

Note that only the files containing Qt specific keywords (like
"signal", "slot"...) need to be passed through "moc". Only
those files are set in the list for the CMake QT_WRAP_CPP
command.

Please let us know if you have further questions,

   Thanks

     Luis



==================================================
Iordanescu, Gheorghe  wrote:
 >
 >....
 >
 > Also I would like to ask if anybody can provide me some
 > examples of adding compilation of QT files to cmake
 > (I guess I should use QT_WRAP_CPP command).
 >
 > Any help will be highly appreciated.
 > Thank you in advance,
 >
 > George




--------------020301040107080104060205
Content-Type: text/plain;
 name="CMakeLists.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="CMakeLists.txt"

PROJECT(QtITKExample)

# 
# Find ITK
#
INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (USE_ITK_FILE)
  INCLUDE(${USE_ITK_FILE})
ENDIF(USE_ITK_FILE)

# 
# Find QT
#
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)

INCLUDE_DIRECTORIES(
${QT_INCLUDE_PATH}
)


LINK_LIBRARIES (
VXLNumerics
ITKCommon
ITKIO
${QT_QT_LIBRARY}
)

SET(QtITK_SRCS
itkQtProgressBar.cxx
qtITK.cxx
)

SET(QtITK_MOC_SRCS 
itkQtAdaptor.h
)

IF(QT_WRAP_CPP)
  QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)
ENDIF(QT_WRAP_CPP)


ADD_EXECUTABLE(QtITK QtITK_SRCS)


--------------020301040107080104060205--