[Insight-users] ITK 4.5 + QT 4.8.4 + CMAKE 2.8.11 not linking

Bill Lorensen bill.lorensen at gmail.com
Tue Aug 20 10:42:28 EDT 2013


target_link_libraries(
ConnectedThreshold  ${ITK_LIBS} ${VTK_LIBS} ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY} QVTK)# ${LINK_LIBRARIES} )
should be
target_link_libraries(
ConnectedThreshold  ${ITK_LIBRARIES} ${VTK_LIBRARIES} ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY} QVTK)# ${LINK_LIBRARIES} )



On Tue, Aug 20, 2013 at 10:28 AM, Jose Ignacio Prieto <
joseignacio.prieto at gmail.com> wrote:

> Hi all, I know this is a problem with cmake but maybe you can help me. I
> am using qt creator 2.4 and the code below. I am trying to use qt +itk+vtk.
> It builds ok but fails in the linking part. I have tried a complete day and
> dont know what else to do. I have commented and uncommented many parts of
> the file. I want to do the same as
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance
>
> I attach a link to the error file (1.2 MB)
> https://www.dropbox.com/s/b8od7tywvlqn4um/building_error.txt
>
> Thank you very much
>
> Ignacio
>
> CMakeLists.txt:
>
>
> cmake_minimum_required(VERSION 2.8)
>  project(ConnectedThresholdDriver)
>
>
> # Find ITK.
>
>
> #SET(CMAKE_PREFIX_PATH /opt/itk5d/lib/cmake/ITK-4.5/)
> #SET(CMAKE_PREFIX_PATH /opt/itk/vtk5/debug8/lib/cmake/ITK-4.5/)
> SET(CMAKE_PREFIX_PATH /opt/itk/vtk5/release3/lib/cmake/ITK-4.5/)
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
> if (ITKVtkGlue_LOADED)
>   find_package(VTK REQUIRED)
>   include(${VTK_USE_FILE})
> endif()
> if (DCMTK_LOADED)
>   find_package(DCMTK REQUIRED)
>   include(${DCMTK_USE_FILE})
> endif()
>
> #SET(CMAKE_PREFIX_PATH /opt/gdcmd)
> #find_package(GDCM REQUIRED)
> #include(${GDCM_USE_FILE})
>
> #SET(ITK_LIBS ITKCommon ITKIOVTK ITKVTK ITKVtkGlue  ITKIODCMTK ITKIOMeta)
>
> # Find  VTK
> #SET(CMAKE_PREFIX_PATH /opt/vtk5d/lib/cmake/vtk-5.10/)
> #FIND_PACKAGE(VTK REQUIRED)
> #INCLUDE(${VTK_USE_FILE})
>
> #SET(VTK_LIBS  vtkRendering vtkCommon vtkIO vtkGraphics vtkHybrid
> vtkImaging)
>
>
> #Find QT
> find_package(Qt4 REQUIRED)
> include(${QT_USE_FILE})
>
>
> #INCLUDE_DIRECTORIES( ${QT_INCLUDES} ${ITK_INCLUDE_DIR} ${VTK_INCLUDE_DIR}
> ${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}
> ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
> ${CMAKE_CURRENT_SOURCE_DIR} )
>
> #SET(LINK_LIBRARIES ${ITK_LIBS} ${VTK_LIBS} ${QT_QTCORE_LIBRARY}
> ${QT_QTGUI_LIBRARY} QVTK)
>
> #LINK_DIRECTORIES(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}
> ${PROJECT_SOURCE_DIR})
>
>
> set(SRC    ConnectedThresholdDriver.cxx ConnectedThreshold.cxx
> ../ItkDCMTKImageIO.cxx ../ItkDCMTKFileReader.cxx
> ../ItkImageSeriesReader.cxx ../ItkDCMTKSeriesFileNames.cxx
> ../ItkDCMTKSeriesFileNames.h ../ItkDCMTKFileReader.h
> ../ItkImageSeriesReader.h ../ItkDCMTKImageIO.h )
>
> set(MOC ConnectedThreshold.h )
> set(UI ConnectedThreshold.ui )
>
>
> qt4_wrap_cpp(MOC_GENERATED ${MOC})
> qt4_wrap_ui(UI_GENERATED ${UI})
>
> INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}
> ${CMAKE_CURRENT_SOURCE_DIR}  )
> #add_library(${UI_GENERATED})
> add_executable(ConnectedThreshold    ${SRC}   ${MOC_GENERATED}
> ${UI_GENERATED}     )
>
>
> target_link_libraries(ConnectedThreshold  ${ITK_LIBS} ${VTK_LIBS}
> ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} QVTK)# ${LINK_LIBRARIES} )
>
>
> --
> José Ignacio Prieto
> celular(nuevo): 94348182
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130820/231b35d2/attachment.htm>


More information about the Insight-users mailing list