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

Jose Ignacio Prieto joseignacio.prieto at gmail.com
Tue Aug 20 10:28:32 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130820/f6ed0cc6/attachment.htm>


More information about the Insight-users mailing list