[Insight-users] Bls: How to use ITK+VTK+QT in an application

SUTRISNO SUTRISNO sutrisno_link at yahoo.com
Sun Mar 28 02:10:23 EDT 2010


Hi Luis,

Thanks, I've successfully compiled qt with cmake.
but when I use vtk ,  errors that occured like this :

 make[2]: *** No rule to make target `/usr/lib/libtiff.so', needed by `qtvtk'.  Stop.
make[2]: Leaving directory `/home/sutrisno/project-sut/qtvtkcmake'
make[1]: *** [CMakeFiles/qtvtk.dir/all] Error 2
make[1]: Leaving directory `/home/sutrisno/project-sut/qtvtkcmake'
make: *** [all] Error 2
root at sutrisno-pc:~/project-sut/qtvtkcmake


Regards,

   Sutrisno
    


________________________________
Dari: Luis Ibanez <luis.ibanez at kitware.com>
Kepada: SUTRISNO SUTRISNO <sutrisno_link at yahoo.com>
Cc: itk <Insight-users at itk.org>
Terkirim: Ming, 28 Maret, 2010 01:23:10
Judul: How to use ITK+VTK+QT in an application

Hi Sutirsno,

Here is what you need in your CMakeLists.txt file
in order to use ITK+VTK+Qt:


FIND_PACKAGE(ITK  REQUIRED)
INCLUDE(${ITK_USE_FILE})

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

FIND_PACKAGE( Qt4   REQUIRED )


INCLUDE_DIRECTORIES(
  ${QT_INCLUDES}
  ${VTK_INCLUDE_DIR}
  ${QT_INCLUDE_DIR}
  ${QT_QTGUI_INCLUDE_DIR}
  ${QT_QTCORE_INCLUDE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  )

LINK_LIBRARIES (
  ITKIO ITKStatistics ITKNumerics
  ${QT_QTCORE_LIBRARY}
  ${QT_QTGUI_LIBRARY}
  vtkCommon
  vtkRendering
  vtkIO
  vtkFiltering
  vtkGraphics
  vtkWidgets
  vtkImaging
  )



Regards,


      Luis




---------------------------------------------------------------------
On Thu, Mar 25, 2010 at 9:35 PM, SUTRISNO SUTRISNO
<sutrisno_link at yahoo.com> wrote:
> Hi Luis,
>
> I've studied hard to configure my project with cmake
> but I am still confused in writing CMakelists.txt
>  Can you help me how to write CMakeList.txt?
>
> I tried it in stages
> 1. Just qt
> 2. qt + vtk
> 3. vtk and qt + ITK
>
> I failed for the first step (qt only). I made a simple program and I tried
> configured with cmake
> my project directory:
>  qtcmake /
>                   - project.pro
>                   - main.cpp
>                   - form1.ui
>                   - form1.ui.h
>
> my CMakeLists.txt :
>
>     cmake_minimum_required(VERSION 2.6)
>     PROJECT(QtCmake)
>     INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)
>     FIND_PACKAGE(Qt3 REQUIRED)
>     INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR})
>     LINK_LIBRARIES( ${QT_QT_LIBRARY})
>     ADD_EXECUTABLE(QtCmake form1.ui.h form1.ui main.cpp  )
>
> But there were error :
>
> root at sutrisno-pc:~/project-sut/qtcmake# cmake .
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/sutrisno/project-sut/qtcmake
> root at sutrisno-pc:~/project-sut/qtcmake# make
> Scanning dependencies of target QtCmake
> [100%] Building CXX object CMakeFiles/QtCmake.dir/main.cpp.o
> /home/sutrisno/project-sut/qtcmake/main.cpp:2:19: error: form1.h: No such
> file or directory
> /home/sutrisno/project-sut/qtcmake/main.cpp: In function ‘int main(int,
> char**)’:
> /home/sutrisno/project-sut/qtcmake/main.cpp:7: error: ‘Form1’ was not
> declared in this scope
> /home/sutrisno/project-sut/qtcmake/main.cpp:7: error: expected `;' before
> ‘w’
> /home/sutrisno/project-sut/qtcmake/main.cpp:8: error: ‘w’ was not declared
> in this scope
> make[2]: *** [CMakeFiles/QtCmake.dir/main.cpp.o] Error 1
> make[1]: *** [CMakeFiles/QtCmake.dir/all] Error 2
> make: *** [all] Error 2
> root at sutrisno-pc:~/project-sut/qtcmake#
>
>
> Regards,
>
>       Sutrisno
> ________________________________



      Yahoo! Mail Kini Lebih Cepat dan Lebih Bersih. Rasakan bedanya sekarang! http://id.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100328/3f82eed9/attachment-0001.htm>


More information about the Insight-users mailing list